//===----------------------------------------------------------------------===//
//
// This source file is part of the Soto for AWS open source project
//
// Copyright (c) 2017-2022 the Soto project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of Soto project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//

// THIS FILE IS AUTOMATICALLY GENERATED by https://github.com/soto-project/soto-codegenerator.
// DO NOT EDIT.

import Foundation
import SotoCore

extension IoTAnalytics {
    // MARK: Enums

    public enum ChannelStatus: String, CustomStringConvertible, Codable, _SotoSendable {
        case active = "ACTIVE"
        case creating = "CREATING"
        case deleting = "DELETING"
        public var description: String { return self.rawValue }
    }

    public enum ComputeType: String, CustomStringConvertible, Codable, _SotoSendable {
        case acu1 = "ACU_1"
        case acu2 = "ACU_2"
        public var description: String { return self.rawValue }
    }

    public enum DatasetActionType: String, CustomStringConvertible, Codable, _SotoSendable {
        case container = "CONTAINER"
        case query = "QUERY"
        public var description: String { return self.rawValue }
    }

    public enum DatasetContentState: String, CustomStringConvertible, Codable, _SotoSendable {
        case creating = "CREATING"
        case failed = "FAILED"
        case succeeded = "SUCCEEDED"
        public var description: String { return self.rawValue }
    }

    public enum DatasetStatus: String, CustomStringConvertible, Codable, _SotoSendable {
        case active = "ACTIVE"
        case creating = "CREATING"
        case deleting = "DELETING"
        public var description: String { return self.rawValue }
    }

    public enum DatastoreStatus: String, CustomStringConvertible, Codable, _SotoSendable {
        case active = "ACTIVE"
        case creating = "CREATING"
        case deleting = "DELETING"
        public var description: String { return self.rawValue }
    }

    public enum FileFormatType: String, CustomStringConvertible, Codable, _SotoSendable {
        case json = "JSON"
        case parquet = "PARQUET"
        public var description: String { return self.rawValue }
    }

    public enum LoggingLevel: String, CustomStringConvertible, Codable, _SotoSendable {
        case error = "ERROR"
        public var description: String { return self.rawValue }
    }

    public enum ReprocessingStatus: String, CustomStringConvertible, Codable, _SotoSendable {
        case cancelled = "CANCELLED"
        case failed = "FAILED"
        case running = "RUNNING"
        case succeeded = "SUCCEEDED"
        public var description: String { return self.rawValue }
    }

    public enum DatastoreStorage: AWSEncodableShape & AWSDecodableShape, _SotoSendable {
        /// S3-customer-managed; When you choose customer-managed storage, the retentionPeriod parameter is ignored. You can't change the choice of Amazon S3 storage after your data store is created.
        case customerManagedS3(CustomerManagedDatastoreS3Storage)
        ///  Used to store data used by IoT SiteWise in an Amazon S3 bucket that you manage. You can't change the choice of Amazon S3 storage after your data store is created.
        case iotSiteWiseMultiLayerStorage(DatastoreIotSiteWiseMultiLayerStorage)
        /// Used to store data in an Amazon S3 bucket managed by IoT Analytics. You can't change the choice of Amazon S3 storage after your data store is created.
        case serviceManagedS3(ServiceManagedDatastoreS3Storage)

        public init(from decoder: Decoder) throws {
            let container = try decoder.container(keyedBy: CodingKeys.self)
            guard container.allKeys.count == 1, let key = container.allKeys.first else {
                let context = DecodingError.Context(
                    codingPath: container.codingPath,
                    debugDescription: "Expected exactly one key, but got \(container.allKeys.count)"
                )
                throw DecodingError.dataCorrupted(context)
            }
            switch key {
            case .customerManagedS3:
                let value = try container.decode(CustomerManagedDatastoreS3Storage.self, forKey: .customerManagedS3)
                self = .customerManagedS3(value)
            case .iotSiteWiseMultiLayerStorage:
                let value = try container.decode(DatastoreIotSiteWiseMultiLayerStorage.self, forKey: .iotSiteWiseMultiLayerStorage)
                self = .iotSiteWiseMultiLayerStorage(value)
            case .serviceManagedS3:
                let value = try container.decode(ServiceManagedDatastoreS3Storage.self, forKey: .serviceManagedS3)
                self = .serviceManagedS3(value)
            }
        }

        public func encode(to encoder: Encoder) throws {
            var container = encoder.container(keyedBy: CodingKeys.self)
            switch self {
            case .customerManagedS3(let value):
                try container.encode(value, forKey: .customerManagedS3)
            case .iotSiteWiseMultiLayerStorage(let value):
                try container.encode(value, forKey: .iotSiteWiseMultiLayerStorage)
            case .serviceManagedS3(let value):
                try container.encode(value, forKey: .serviceManagedS3)
            }
        }

        public func validate(name: String) throws {
            switch self {
            case .customerManagedS3(let value):
                try value.validate(name: "\(name).customerManagedS3")
            case .iotSiteWiseMultiLayerStorage(let value):
                try value.validate(name: "\(name).iotSiteWiseMultiLayerStorage")
            default:
                break
            }
        }

        private enum CodingKeys: String, CodingKey {
            case customerManagedS3
            case iotSiteWiseMultiLayerStorage
            case serviceManagedS3
        }
    }

    // MARK: Shapes

    public struct AddAttributesActivity: AWSEncodableShape & AWSDecodableShape {
        /// A list of 1-50 AttributeNameMapping objects that map an existing attribute to a new attribute.  The existing attributes remain in the message, so if you want to remove the originals, use RemoveAttributeActivity.
        public let attributes: [String: String]
        /// The name of the addAttributes activity.
        public let name: String
        /// The next activity in the pipeline.
        public let next: String?

        public init(attributes: [String: String], name: String, next: String? = nil) {
            self.attributes = attributes
            self.name = name
            self.next = next
        }

        public func validate(name: String) throws {
            try self.attributes.forEach {
                try validate($0.key, name: "attributes.key", parent: name, max: 256)
                try validate($0.key, name: "attributes.key", parent: name, min: 1)
                try validate($0.value, name: "attributes[\"\($0.key)\"]", parent: name, max: 256)
                try validate($0.value, name: "attributes[\"\($0.key)\"]", parent: name, min: 1)
            }
            try self.validate(self.attributes, name: "attributes", parent: name, max: 50)
            try self.validate(self.attributes, name: "attributes", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, max: 128)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.next, name: "next", parent: name, max: 128)
            try self.validate(self.next, name: "next", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case attributes
            case name
            case next
        }
    }

    public struct BatchPutMessageErrorEntry: AWSDecodableShape {
        /// The code associated with the error.
        public let errorCode: String?
        /// The message associated with the error.
        public let errorMessage: String?
        /// The ID of the message that caused the error. See the value corresponding to the messageId key in the message object.
        public let messageId: String?

        public init(errorCode: String? = nil, errorMessage: String? = nil, messageId: String? = nil) {
            self.errorCode = errorCode
            self.errorMessage = errorMessage
            self.messageId = messageId
        }

        private enum CodingKeys: String, CodingKey {
            case errorCode
            case errorMessage
            case messageId
        }
    }

    public struct BatchPutMessageRequest: AWSEncodableShape {
        /// The name of the channel where the messages are sent.
        public let channelName: String
        /// The list of messages to be sent. Each message has the format: { "messageId": "string", "payload": "string"}. The field names of message payloads (data) that you send to IoT Analytics:   Must contain only alphanumeric characters and undescores (_). No other special characters are allowed.   Must begin with an alphabetic character or single underscore (_).   Cannot contain hyphens (-).   In regular expression terms: "^[A-Za-z_]([A-Za-z0-9]*|[A-Za-z0-9][A-Za-z0-9_]*)$".    Cannot be more than 255 characters.   Are case insensitive. (Fields named foo and FOO in the same payload are considered duplicates.)   For example, {"temp_01": 29} or {"_temp_01": 29} are valid, but {"temp-01": 29}, {"01_temp": 29} or {"__temp_01": 29} are invalid in message payloads.
        public let messages: [Message]

        public init(channelName: String, messages: [Message]) {
            self.channelName = channelName
            self.messages = messages
        }

        public func validate(name: String) throws {
            try self.validate(self.channelName, name: "channelName", parent: name, max: 128)
            try self.validate(self.channelName, name: "channelName", parent: name, min: 1)
            try self.validate(self.channelName, name: "channelName", parent: name, pattern: "^(^(?!_{2}))(^[a-zA-Z0-9_]+$)$")
            try self.messages.forEach {
                try $0.validate(name: "\(name).messages[]")
            }
        }

        private enum CodingKeys: String, CodingKey {
            case channelName
            case messages
        }
    }

    public struct BatchPutMessageResponse: AWSDecodableShape {
        /// A list of any errors encountered when sending the messages to the channel.
        public let batchPutMessageErrorEntries: [BatchPutMessageErrorEntry]?

        public init(batchPutMessageErrorEntries: [BatchPutMessageErrorEntry]? = nil) {
            self.batchPutMessageErrorEntries = batchPutMessageErrorEntries
        }

        private enum CodingKeys: String, CodingKey {
            case batchPutMessageErrorEntries
        }
    }

    public struct CancelPipelineReprocessingRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "pipelineName", location: .uri("pipelineName")),
            AWSMemberEncoding(label: "reprocessingId", location: .uri("reprocessingId"))
        ]

        /// The name of pipeline for which data reprocessing is canceled.
        public let pipelineName: String
        /// The ID of the reprocessing task (returned by StartPipelineReprocessing).
        public let reprocessingId: String

        public init(pipelineName: String, reprocessingId: String) {
            self.pipelineName = pipelineName
            self.reprocessingId = reprocessingId
        }

        public func validate(name: String) throws {
            try self.validate(self.pipelineName, name: "pipelineName", parent: name, max: 128)
            try self.validate(self.pipelineName, name: "pipelineName", parent: name, min: 1)
            try self.validate(self.pipelineName, name: "pipelineName", parent: name, pattern: "^(^(?!_{2}))(^[a-zA-Z0-9_]+$)$")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct CancelPipelineReprocessingResponse: AWSDecodableShape {
        public init() {}
    }

    public struct Channel: AWSDecodableShape {
        /// The ARN of the channel.
        public let arn: String?
        /// When the channel was created.
        public let creationTime: Date?
        /// The last time when a new message arrived in the channel.  IoT Analytics updates this value at most once per minute for one channel. Hence, the lastMessageArrivalTime value is an approximation.  This feature only applies to messages that arrived in the data store after October 23, 2020.
        public let lastMessageArrivalTime: Date?
        /// When the channel was last updated.
        public let lastUpdateTime: Date?
        /// The name of the channel.
        public let name: String?
        /// How long, in days, message data is kept for the channel.
        public let retentionPeriod: RetentionPeriod?
        /// The status of the channel.
        public let status: ChannelStatus?
        /// Where channel data is stored. You can choose one of serviceManagedS3 or customerManagedS3 storage. If not specified, the default is serviceManagedS3. You can't change this storage option after the channel is created.
        public let storage: ChannelStorage?

        public init(arn: String? = nil, creationTime: Date? = nil, lastMessageArrivalTime: Date? = nil, lastUpdateTime: Date? = nil, name: String? = nil, retentionPeriod: RetentionPeriod? = nil, status: ChannelStatus? = nil, storage: ChannelStorage? = nil) {
            self.arn = arn
            self.creationTime = creationTime
            self.lastMessageArrivalTime = lastMessageArrivalTime
            self.lastUpdateTime = lastUpdateTime
            self.name = name
            self.retentionPeriod = retentionPeriod
            self.status = status
            self.storage = storage
        }

        private enum CodingKeys: String, CodingKey {
            case arn
            case creationTime
            case lastMessageArrivalTime
            case lastUpdateTime
            case name
            case retentionPeriod
            case status
            case storage
        }
    }

    public struct ChannelActivity: AWSEncodableShape & AWSDecodableShape {
        /// The name of the channel from which the messages are processed.
        public let channelName: String
        /// The name of the channel activity.
        public let name: String
        /// The next activity in the pipeline.
        public let next: String?

        public init(channelName: String, name: String, next: String? = nil) {
            self.channelName = channelName
            self.name = name
            self.next = next
        }

        public func validate(name: String) throws {
            try self.validate(self.channelName, name: "channelName", parent: name, max: 128)
            try self.validate(self.channelName, name: "channelName", parent: name, min: 1)
            try self.validate(self.channelName, name: "channelName", parent: name, pattern: "^(^(?!_{2}))(^[a-zA-Z0-9_]+$)$")
            try self.validate(self.name, name: "name", parent: name, max: 128)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.next, name: "next", parent: name, max: 128)
            try self.validate(self.next, name: "next", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case channelName
            case name
            case next
        }
    }

    public struct ChannelMessages: AWSEncodableShape {
        /// Specifies one or more keys that identify the Amazon Simple Storage Service (Amazon S3) objects that save your channel messages. You must use the full path for the key. Example path: channel/mychannel/__dt=2020-02-29 00:00:00/1582940490000_1582940520000_123456789012_mychannel_0_2118.0.json.gz
        public let s3Paths: [String]?

        public init(s3Paths: [String]? = nil) {
            self.s3Paths = s3Paths
        }

        public func validate(name: String) throws {
            try self.s3Paths?.forEach {
                try validate($0, name: "s3Paths[]", parent: name, max: 1024)
                try validate($0, name: "s3Paths[]", parent: name, min: 1)
                try validate($0, name: "s3Paths[]", parent: name, pattern: "^[a-zA-Z0-9/_!'(){}\\*\\s\\.\\-\\=\\:]+$")
            }
            try self.validate(self.s3Paths, name: "s3Paths", parent: name, max: 100)
            try self.validate(self.s3Paths, name: "s3Paths", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case s3Paths
        }
    }

    public struct ChannelStatistics: AWSDecodableShape {
        /// The estimated size of the channel.
        public let size: EstimatedResourceSize?

        public init(size: EstimatedResourceSize? = nil) {
            self.size = size
        }

        private enum CodingKeys: String, CodingKey {
            case size
        }
    }

    public struct ChannelStorage: AWSEncodableShape & AWSDecodableShape {
        /// Used to store channel data in an S3 bucket that you manage. If customer managed storage is selected, the retentionPeriod parameter is ignored. You can't change the choice of S3 storage after the data store is created.
        public let customerManagedS3: CustomerManagedChannelS3Storage?
        /// Used to store channel data in an S3 bucket managed by IoT Analytics. You can't change the choice of S3 storage after the data store is created.
        public let serviceManagedS3: ServiceManagedChannelS3Storage?

        public init(customerManagedS3: CustomerManagedChannelS3Storage? = nil, serviceManagedS3: ServiceManagedChannelS3Storage? = nil) {
            self.customerManagedS3 = customerManagedS3
            self.serviceManagedS3 = serviceManagedS3
        }

        public func validate(name: String) throws {
            try self.customerManagedS3?.validate(name: "\(name).customerManagedS3")
        }

        private enum CodingKeys: String, CodingKey {
            case customerManagedS3
            case serviceManagedS3
        }
    }

    public struct ChannelStorageSummary: AWSDecodableShape {
        /// Used to store channel data in an S3 bucket that you manage.
        public let customerManagedS3: CustomerManagedChannelS3StorageSummary?
        /// Used to store channel data in an S3 bucket managed by IoT Analytics.
        public let serviceManagedS3: ServiceManagedChannelS3StorageSummary?

        public init(customerManagedS3: CustomerManagedChannelS3StorageSummary? = nil, serviceManagedS3: ServiceManagedChannelS3StorageSummary? = nil) {
            self.customerManagedS3 = customerManagedS3
            self.serviceManagedS3 = serviceManagedS3
        }

        private enum CodingKeys: String, CodingKey {
            case customerManagedS3
            case serviceManagedS3
        }
    }

    public struct ChannelSummary: AWSDecodableShape {
        /// The name of the channel.
        public let channelName: String?
        /// Where channel data is stored.
        public let channelStorage: ChannelStorageSummary?
        /// When the channel was created.
        public let creationTime: Date?
        /// The last time when a new message arrived in the channel.  IoT Analytics updates this value at most once per minute for one channel. Hence, the lastMessageArrivalTime value is an approximation.  This feature only applies to messages that arrived in the data store after October 23, 2020.
        public let lastMessageArrivalTime: Date?
        /// The last time the channel was updated.
        public let lastUpdateTime: Date?
        /// The status of the channel.
        public let status: ChannelStatus?

        public init(channelName: String? = nil, channelStorage: ChannelStorageSummary? = nil, creationTime: Date? = nil, lastMessageArrivalTime: Date? = nil, lastUpdateTime: Date? = nil, status: ChannelStatus? = nil) {
            self.channelName = channelName
            self.channelStorage = channelStorage
            self.creationTime = creationTime
            self.lastMessageArrivalTime = lastMessageArrivalTime
            self.lastUpdateTime = lastUpdateTime
            self.status = status
        }

        private enum CodingKeys: String, CodingKey {
            case channelName
            case channelStorage
            case creationTime
            case lastMessageArrivalTime
            case lastUpdateTime
            case status
        }
    }

    public struct Column: AWSEncodableShape & AWSDecodableShape {
        /// The name of the column.
        public let name: String
        /// The type of data. For more information about the supported data types, see Common data types in the Glue Developer Guide.
        public let type: String

        public init(name: String, type: String) {
            self.name = name
            self.type = type
        }

        public func validate(name: String) throws {
            try self.validate(self.name, name: "name", parent: name, max: 255)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, pattern: "^[A-Za-z_]([A-Za-z0-9]*|[A-Za-z0-9][A-Za-z0-9_]*)$")
            try self.validate(self.type, name: "type", parent: name, max: 131_072)
            try self.validate(self.type, name: "type", parent: name, min: 1)
            try self.validate(self.type, name: "type", parent: name, pattern: "^[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\t]*$")
        }

        private enum CodingKeys: String, CodingKey {
            case name
            case type
        }
    }

    public struct ContainerDatasetAction: AWSEncodableShape & AWSDecodableShape {
        /// The ARN of the role that gives permission to the system to access required resources to run the containerAction. This includes, at minimum, permission to retrieve the dataset contents that are the input to the containerized application.
        public let executionRoleArn: String
        /// The ARN of the Docker container stored in your account. The Docker container contains an application and required support libraries and is used to generate dataset contents.
        public let image: String
        /// Configuration of the resource that executes the containerAction.
        public let resourceConfiguration: ResourceConfiguration
        /// The values of variables used in the context of the execution of the containerized application (basically, parameters passed to the application). Each variable must have a name and a value given by one of stringValue, datasetContentVersionValue, or outputFileUriValue.
        public let variables: [Variable]?

        public init(executionRoleArn: String, image: String, resourceConfiguration: ResourceConfiguration, variables: [Variable]? = nil) {
            self.executionRoleArn = executionRoleArn
            self.image = image
            self.resourceConfiguration = resourceConfiguration
            self.variables = variables
        }

        public func validate(name: String) throws {
            try self.validate(self.executionRoleArn, name: "executionRoleArn", parent: name, max: 2048)
            try self.validate(self.executionRoleArn, name: "executionRoleArn", parent: name, min: 20)
            try self.validate(self.image, name: "image", parent: name, max: 255)
            try self.resourceConfiguration.validate(name: "\(name).resourceConfiguration")
            try self.variables?.forEach {
                try $0.validate(name: "\(name).variables[]")
            }
            try self.validate(self.variables, name: "variables", parent: name, max: 50)
        }

        private enum CodingKeys: String, CodingKey {
            case executionRoleArn
            case image
            case resourceConfiguration
            case variables
        }
    }

    public struct CreateChannelRequest: AWSEncodableShape {
        /// The name of the channel.
        public let channelName: String
        /// Where channel data is stored. You can choose one of serviceManagedS3 or customerManagedS3 storage. If not specified, the default is serviceManagedS3. You can't change this storage option after the channel is created.
        public let channelStorage: ChannelStorage?
        /// How long, in days, message data is kept for the channel. When customerManagedS3 storage is selected, this parameter is ignored.
        public let retentionPeriod: RetentionPeriod?
        /// Metadata which can be used to manage the channel.
        public let tags: [Tag]?

        public init(channelName: String, channelStorage: ChannelStorage? = nil, retentionPeriod: RetentionPeriod? = nil, tags: [Tag]? = nil) {
            self.channelName = channelName
            self.channelStorage = channelStorage
            self.retentionPeriod = retentionPeriod
            self.tags = tags
        }

        public func validate(name: String) throws {
            try self.validate(self.channelName, name: "channelName", parent: name, max: 128)
            try self.validate(self.channelName, name: "channelName", parent: name, min: 1)
            try self.validate(self.channelName, name: "channelName", parent: name, pattern: "^(^(?!_{2}))(^[a-zA-Z0-9_]+$)$")
            try self.channelStorage?.validate(name: "\(name).channelStorage")
            try self.retentionPeriod?.validate(name: "\(name).retentionPeriod")
            try self.tags?.forEach {
                try $0.validate(name: "\(name).tags[]")
            }
            try self.validate(self.tags, name: "tags", parent: name, max: 50)
            try self.validate(self.tags, name: "tags", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case channelName
            case channelStorage
            case retentionPeriod
            case tags
        }
    }

    public struct CreateChannelResponse: AWSDecodableShape {
        /// The ARN of the channel.
        public let channelArn: String?
        /// The name of the channel.
        public let channelName: String?
        /// How long, in days, message data is kept for the channel.
        public let retentionPeriod: RetentionPeriod?

        public init(channelArn: String? = nil, channelName: String? = nil, retentionPeriod: RetentionPeriod? = nil) {
            self.channelArn = channelArn
            self.channelName = channelName
            self.retentionPeriod = retentionPeriod
        }

        private enum CodingKeys: String, CodingKey {
            case channelArn
            case channelName
            case retentionPeriod
        }
    }

    public struct CreateDatasetContentRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "datasetName", location: .uri("datasetName"))
        ]

        /// The name of the dataset.
        public let datasetName: String
        /// The version ID of the dataset content. To specify versionId for a dataset content, the dataset must use a DeltaTimer filter.
        public let versionId: String?

        public init(datasetName: String, versionId: String? = nil) {
            self.datasetName = datasetName
            self.versionId = versionId
        }

        public func validate(name: String) throws {
            try self.validate(self.datasetName, name: "datasetName", parent: name, max: 128)
            try self.validate(self.datasetName, name: "datasetName", parent: name, min: 1)
            try self.validate(self.datasetName, name: "datasetName", parent: name, pattern: "^(^(?!_{2}))(^[a-zA-Z0-9_]+$)$")
            try self.validate(self.versionId, name: "versionId", parent: name, max: 36)
            try self.validate(self.versionId, name: "versionId", parent: name, min: 7)
        }

        private enum CodingKeys: String, CodingKey {
            case versionId
        }
    }

    public struct CreateDatasetContentResponse: AWSDecodableShape {
        /// The version ID of the dataset contents that are being created.
        public let versionId: String?

        public init(versionId: String? = nil) {
            self.versionId = versionId
        }

        private enum CodingKeys: String, CodingKey {
            case versionId
        }
    }

    public struct CreateDatasetRequest: AWSEncodableShape {
        /// A list of actions that create the dataset contents.
        public let actions: [DatasetAction]
        /// When dataset contents are created, they are delivered to destinations specified here.
        public let contentDeliveryRules: [DatasetContentDeliveryRule]?
        /// The name of the dataset.
        public let datasetName: String
        /// A list of data rules that send notifications to CloudWatch, when data arrives late. To specify lateDataRules, the dataset must use a DeltaTimer filter.
        public let lateDataRules: [LateDataRule]?
        /// Optional. How long, in days, versions of dataset contents are kept for the dataset. If not specified or set to null, versions of dataset contents are retained for at most 90 days. The number of versions of dataset contents retained is determined by the versioningConfiguration parameter. For more information, see  Keeping Multiple Versions of IoT Analytics datasets in the IoT Analytics User Guide.
        public let retentionPeriod: RetentionPeriod?
        /// Metadata which can be used to manage the dataset.
        public let tags: [Tag]?
        /// A list of triggers. A trigger causes dataset contents to be populated at a specified time interval or when another dataset's contents are created. The list of triggers can be empty or contain up to five DataSetTrigger objects.
        public let triggers: [DatasetTrigger]?
        /// Optional. How many versions of dataset contents are kept. If not specified or set to null, only the latest version plus the latest succeeded version (if they are different) are kept for the time period specified by the retentionPeriod parameter. For more information, see Keeping Multiple Versions of IoT Analytics datasets in the IoT Analytics User Guide.
        public let versioningConfiguration: VersioningConfiguration?

        public init(actions: [DatasetAction], contentDeliveryRules: [DatasetContentDeliveryRule]? = nil, datasetName: String, lateDataRules: [LateDataRule]? = nil, retentionPeriod: RetentionPeriod? = nil, tags: [Tag]? = nil, triggers: [DatasetTrigger]? = nil, versioningConfiguration: VersioningConfiguration? = nil) {
            self.actions = actions
            self.contentDeliveryRules = contentDeliveryRules
            self.datasetName = datasetName
            self.lateDataRules = lateDataRules
            self.retentionPeriod = retentionPeriod
            self.tags = tags
            self.triggers = triggers
            self.versioningConfiguration = versioningConfiguration
        }

        public func validate(name: String) throws {
            try self.actions.forEach {
                try $0.validate(name: "\(name).actions[]")
            }
            try self.validate(self.actions, name: "actions", parent: name, max: 1)
            try self.validate(self.actions, name: "actions", parent: name, min: 1)
            try self.contentDeliveryRules?.forEach {
                try $0.validate(name: "\(name).contentDeliveryRules[]")
            }
            try self.validate(self.contentDeliveryRules, name: "contentDeliveryRules", parent: name, max: 20)
            try self.validate(self.datasetName, name: "datasetName", parent: name, max: 128)
            try self.validate(self.datasetName, name: "datasetName", parent: name, min: 1)
            try self.validate(self.datasetName, name: "datasetName", parent: name, pattern: "^(^(?!_{2}))(^[a-zA-Z0-9_]+$)$")
            try self.lateDataRules?.forEach {
                try $0.validate(name: "\(name).lateDataRules[]")
            }
            try self.validate(self.lateDataRules, name: "lateDataRules", parent: name, max: 1)
            try self.validate(self.lateDataRules, name: "lateDataRules", parent: name, min: 1)
            try self.retentionPeriod?.validate(name: "\(name).retentionPeriod")
            try self.tags?.forEach {
                try $0.validate(name: "\(name).tags[]")
            }
            try self.validate(self.tags, name: "tags", parent: name, max: 50)
            try self.validate(self.tags, name: "tags", parent: name, min: 1)
            try self.triggers?.forEach {
                try $0.validate(name: "\(name).triggers[]")
            }
            try self.validate(self.triggers, name: "triggers", parent: name, max: 5)
            try self.versioningConfiguration?.validate(name: "\(name).versioningConfiguration")
        }

        private enum CodingKeys: String, CodingKey {
            case actions
            case contentDeliveryRules
            case datasetName
            case lateDataRules
            case retentionPeriod
            case tags
            case triggers
            case versioningConfiguration
        }
    }

    public struct CreateDatasetResponse: AWSDecodableShape {
        /// The ARN of the dataset.
        public let datasetArn: String?
        /// The name of the dataset.
        public let datasetName: String?
        /// How long, in days, dataset contents are kept for the dataset.
        public let retentionPeriod: RetentionPeriod?

        public init(datasetArn: String? = nil, datasetName: String? = nil, retentionPeriod: RetentionPeriod? = nil) {
            self.datasetArn = datasetArn
            self.datasetName = datasetName
            self.retentionPeriod = retentionPeriod
        }

        private enum CodingKeys: String, CodingKey {
            case datasetArn
            case datasetName
            case retentionPeriod
        }
    }

    public struct CreateDatastoreRequest: AWSEncodableShape {
        /// The name of the data store.
        public let datastoreName: String
        ///  Contains information about the partition dimensions in a data store.
        public let datastorePartitions: DatastorePartitions?
        /// Where data in a data store is stored.. You can choose serviceManagedS3 storage, customerManagedS3 storage, or iotSiteWiseMultiLayerStorage storage. The default is serviceManagedS3. You can't change the choice of Amazon S3 storage after your data store is created.
        public let datastoreStorage: DatastoreStorage?
        /// Contains the configuration information of file formats.  IoT Analytics data stores support JSON and Parquet.  The default file format is JSON. You can specify only one format.  You can't change the file format after you create the data store.
        public let fileFormatConfiguration: FileFormatConfiguration?
        /// How long, in days, message data is kept for the data store. When customerManagedS3 storage is selected, this parameter is ignored.
        public let retentionPeriod: RetentionPeriod?
        /// Metadata which can be used to manage the data store.
        public let tags: [Tag]?

        public init(datastoreName: String, datastorePartitions: DatastorePartitions? = nil, datastoreStorage: DatastoreStorage? = nil, fileFormatConfiguration: FileFormatConfiguration? = nil, retentionPeriod: RetentionPeriod? = nil, tags: [Tag]? = nil) {
            self.datastoreName = datastoreName
            self.datastorePartitions = datastorePartitions
            self.datastoreStorage = datastoreStorage
            self.fileFormatConfiguration = fileFormatConfiguration
            self.retentionPeriod = retentionPeriod
            self.tags = tags
        }

        public func validate(name: String) throws {
            try self.validate(self.datastoreName, name: "datastoreName", parent: name, max: 128)
            try self.validate(self.datastoreName, name: "datastoreName", parent: name, min: 1)
            try self.validate(self.datastoreName, name: "datastoreName", parent: name, pattern: "^(^(?!_{2}))(^[a-zA-Z0-9_]+$)$")
            try self.datastorePartitions?.validate(name: "\(name).datastorePartitions")
            try self.datastoreStorage?.validate(name: "\(name).datastoreStorage")
            try self.fileFormatConfiguration?.validate(name: "\(name).fileFormatConfiguration")
            try self.retentionPeriod?.validate(name: "\(name).retentionPeriod")
            try self.tags?.forEach {
                try $0.validate(name: "\(name).tags[]")
            }
            try self.validate(self.tags, name: "tags", parent: name, max: 50)
            try self.validate(self.tags, name: "tags", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case datastoreName
            case datastorePartitions
            case datastoreStorage
            case fileFormatConfiguration
            case retentionPeriod
            case tags
        }
    }

    public struct CreateDatastoreResponse: AWSDecodableShape {
        /// The ARN of the data store.
        public let datastoreArn: String?
        /// The name of the data store.
        public let datastoreName: String?
        /// How long, in days, message data is kept for the data store.
        public let retentionPeriod: RetentionPeriod?

        public init(datastoreArn: String? = nil, datastoreName: String? = nil, retentionPeriod: RetentionPeriod? = nil) {
            self.datastoreArn = datastoreArn
            self.datastoreName = datastoreName
            self.retentionPeriod = retentionPeriod
        }

        private enum CodingKeys: String, CodingKey {
            case datastoreArn
            case datastoreName
            case retentionPeriod
        }
    }

    public struct CreatePipelineRequest: AWSEncodableShape {
        /// A list of PipelineActivity objects. Activities perform transformations on your messages, such as removing, renaming or adding message attributes; filtering messages based on attribute values; invoking your Lambda unctions on messages for advanced processing; or performing mathematical transformations to normalize device data. The list can be 2-25 PipelineActivity objects and must contain both a channel and a datastore activity. Each entry in the list must contain only one activity. For example:  pipelineActivities = [ { "channel": { ... } }, { "lambda": { ... } }, ... ]
        public let pipelineActivities: [PipelineActivity]
        /// The name of the pipeline.
        public let pipelineName: String
        /// Metadata which can be used to manage the pipeline.
        public let tags: [Tag]?

        public init(pipelineActivities: [PipelineActivity], pipelineName: String, tags: [Tag]? = nil) {
            self.pipelineActivities = pipelineActivities
            self.pipelineName = pipelineName
            self.tags = tags
        }

        public func validate(name: String) throws {
            try self.pipelineActivities.forEach {
                try $0.validate(name: "\(name).pipelineActivities[]")
            }
            try self.validate(self.pipelineActivities, name: "pipelineActivities", parent: name, max: 25)
            try self.validate(self.pipelineActivities, name: "pipelineActivities", parent: name, min: 1)
            try self.validate(self.pipelineName, name: "pipelineName", parent: name, max: 128)
            try self.validate(self.pipelineName, name: "pipelineName", parent: name, min: 1)
            try self.validate(self.pipelineName, name: "pipelineName", parent: name, pattern: "^(^(?!_{2}))(^[a-zA-Z0-9_]+$)$")
            try self.tags?.forEach {
                try $0.validate(name: "\(name).tags[]")
            }
            try self.validate(self.tags, name: "tags", parent: name, max: 50)
            try self.validate(self.tags, name: "tags", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case pipelineActivities
            case pipelineName
            case tags
        }
    }

    public struct CreatePipelineResponse: AWSDecodableShape {
        /// The ARN of the pipeline.
        public let pipelineArn: String?
        /// The name of the pipeline.
        public let pipelineName: String?

        public init(pipelineArn: String? = nil, pipelineName: String? = nil) {
            self.pipelineArn = pipelineArn
            self.pipelineName = pipelineName
        }

        private enum CodingKeys: String, CodingKey {
            case pipelineArn
            case pipelineName
        }
    }

    public struct CustomerManagedChannelS3Storage: AWSEncodableShape & AWSDecodableShape {
        /// The name of the S3 bucket in which channel data is stored.
        public let bucket: String
        /// (Optional) The prefix used to create the keys of the channel data objects. Each object in an S3 bucket has a key that is its unique identifier in the bucket. Each object in a bucket has exactly one key. The prefix must end with a forward slash (/).
        public let keyPrefix: String?
        /// The ARN of the role that grants IoT Analytics permission to interact with your Amazon S3 resources.
        public let roleArn: String

        public init(bucket: String, keyPrefix: String? = nil, roleArn: String) {
            self.bucket = bucket
            self.keyPrefix = keyPrefix
            self.roleArn = roleArn
        }

        public func validate(name: String) throws {
            try self.validate(self.bucket, name: "bucket", parent: name, max: 255)
            try self.validate(self.bucket, name: "bucket", parent: name, min: 3)
            try self.validate(self.bucket, name: "bucket", parent: name, pattern: "^[a-zA-Z0-9.\\-_]*$")
            try self.validate(self.keyPrefix, name: "keyPrefix", parent: name, max: 255)
            try self.validate(self.keyPrefix, name: "keyPrefix", parent: name, min: 1)
            try self.validate(self.keyPrefix, name: "keyPrefix", parent: name, pattern: "^[a-zA-Z0-9!_.*'()/{}:-]*/$")
            try self.validate(self.roleArn, name: "roleArn", parent: name, max: 2048)
            try self.validate(self.roleArn, name: "roleArn", parent: name, min: 20)
        }

        private enum CodingKeys: String, CodingKey {
            case bucket
            case keyPrefix
            case roleArn
        }
    }

    public struct CustomerManagedChannelS3StorageSummary: AWSDecodableShape {
        /// The name of the S3 bucket in which channel data is stored.
        public let bucket: String?
        /// (Optional) The prefix used to create the keys of the channel data objects. Each object in an S3 bucket has a key that is its unique identifier within the bucket (each object in a bucket has exactly one key). The prefix must end with a forward slash (/).
        public let keyPrefix: String?
        /// The ARN of the role that grants IoT Analytics permission to interact with your Amazon S3 resources.
        public let roleArn: String?

        public init(bucket: String? = nil, keyPrefix: String? = nil, roleArn: String? = nil) {
            self.bucket = bucket
            self.keyPrefix = keyPrefix
            self.roleArn = roleArn
        }

        private enum CodingKeys: String, CodingKey {
            case bucket
            case keyPrefix
            case roleArn
        }
    }

    public struct CustomerManagedDatastoreS3Storage: AWSEncodableShape & AWSDecodableShape {
        /// The name of the Amazon S3 bucket where your data is stored.
        public let bucket: String
        /// (Optional) The prefix used to create the keys of the data store data objects. Each object in an Amazon S3 bucket has a key that is its unique identifier in the bucket. Each object in a bucket has exactly one key. The prefix must end with a forward slash (/).
        public let keyPrefix: String?
        /// The ARN of the role that grants IoT Analytics permission to interact with your Amazon S3 resources.
        public let roleArn: String

        public init(bucket: String, keyPrefix: String? = nil, roleArn: String) {
            self.bucket = bucket
            self.keyPrefix = keyPrefix
            self.roleArn = roleArn
        }

        public func validate(name: String) throws {
            try self.validate(self.bucket, name: "bucket", parent: name, max: 255)
            try self.validate(self.bucket, name: "bucket", parent: name, min: 3)
            try self.validate(self.bucket, name: "bucket", parent: name, pattern: "^[a-zA-Z0-9.\\-_]*$")
            try self.validate(self.keyPrefix, name: "keyPrefix", parent: name, max: 255)
            try self.validate(self.keyPrefix, name: "keyPrefix", parent: name, min: 1)
            try self.validate(self.keyPrefix, name: "keyPrefix", parent: name, pattern: "^[a-zA-Z0-9!_.*'()/{}:-]*/$")
            try self.validate(self.roleArn, name: "roleArn", parent: name, max: 2048)
            try self.validate(self.roleArn, name: "roleArn", parent: name, min: 20)
        }

        private enum CodingKeys: String, CodingKey {
            case bucket
            case keyPrefix
            case roleArn
        }
    }

    public struct CustomerManagedDatastoreS3StorageSummary: AWSDecodableShape {
        /// The name of the Amazon S3 bucket where your data is stored.
        public let bucket: String?
        /// (Optional) The prefix used to create the keys of the data store data objects. Each object in an Amazon S3 bucket has a key that is its unique identifier in the bucket. Each object in a bucket has exactly one key. The prefix must end with a forward slash (/).
        public let keyPrefix: String?
        /// The ARN of the role that grants IoT Analytics permission to interact with your Amazon S3 resources.
        public let roleArn: String?

        public init(bucket: String? = nil, keyPrefix: String? = nil, roleArn: String? = nil) {
            self.bucket = bucket
            self.keyPrefix = keyPrefix
            self.roleArn = roleArn
        }

        private enum CodingKeys: String, CodingKey {
            case bucket
            case keyPrefix
            case roleArn
        }
    }

    public struct Dataset: AWSDecodableShape {
        /// The DatasetAction objects that automatically create the dataset contents.
        public let actions: [DatasetAction]?
        /// The ARN of the dataset.
        public let arn: String?
        /// When dataset contents are created they are delivered to destinations specified here.
        public let contentDeliveryRules: [DatasetContentDeliveryRule]?
        /// When the dataset was created.
        public let creationTime: Date?
        /// The last time the dataset was updated.
        public let lastUpdateTime: Date?
        /// A list of data rules that send notifications to CloudWatch, when data arrives late. To specify lateDataRules, the dataset must use a DeltaTimer filter.
        public let lateDataRules: [LateDataRule]?
        /// The name of the dataset.
        public let name: String?
        /// Optional. How long, in days, message data is kept for the dataset.
        public let retentionPeriod: RetentionPeriod?
        /// The status of the dataset.
        public let status: DatasetStatus?
        /// The DatasetTrigger objects that specify when the dataset is automatically updated.
        public let triggers: [DatasetTrigger]?
        /// Optional. How many versions of dataset contents are kept. If not specified or set to null, only the latest version plus the latest succeeded version (if they are different) are kept for the time period specified by the retentionPeriod parameter. For more information, see  Keeping Multiple Versions of IoT Analytics datasets in the IoT Analytics User Guide.
        public let versioningConfiguration: VersioningConfiguration?

        public init(actions: [DatasetAction]? = nil, arn: String? = nil, contentDeliveryRules: [DatasetContentDeliveryRule]? = nil, creationTime: Date? = nil, lastUpdateTime: Date? = nil, lateDataRules: [LateDataRule]? = nil, name: String? = nil, retentionPeriod: RetentionPeriod? = nil, status: DatasetStatus? = nil, triggers: [DatasetTrigger]? = nil, versioningConfiguration: VersioningConfiguration? = nil) {
            self.actions = actions
            self.arn = arn
            self.contentDeliveryRules = contentDeliveryRules
            self.creationTime = creationTime
            self.lastUpdateTime = lastUpdateTime
            self.lateDataRules = lateDataRules
            self.name = name
            self.retentionPeriod = retentionPeriod
            self.status = status
            self.triggers = triggers
            self.versioningConfiguration = versioningConfiguration
        }

        private enum CodingKeys: String, CodingKey {
            case actions
            case arn
            case contentDeliveryRules
            case creationTime
            case lastUpdateTime
            case lateDataRules
            case name
            case retentionPeriod
            case status
            case triggers
            case versioningConfiguration
        }
    }

    public struct DatasetAction: AWSEncodableShape & AWSDecodableShape {
        /// The name of the dataset action by which dataset contents are automatically created.
        public let actionName: String?
        /// Information that allows the system to run a containerized application to create the dataset contents. The application must be in a Docker container along with any required support libraries.
        public let containerAction: ContainerDatasetAction?
        /// An SqlQueryDatasetAction object that uses an SQL query to automatically create dataset contents.
        public let queryAction: SqlQueryDatasetAction?

        public init(actionName: String? = nil, containerAction: ContainerDatasetAction? = nil, queryAction: SqlQueryDatasetAction? = nil) {
            self.actionName = actionName
            self.containerAction = containerAction
            self.queryAction = queryAction
        }

        public func validate(name: String) throws {
            try self.validate(self.actionName, name: "actionName", parent: name, max: 128)
            try self.validate(self.actionName, name: "actionName", parent: name, min: 1)
            try self.validate(self.actionName, name: "actionName", parent: name, pattern: "^[a-zA-Z0-9_]+$")
            try self.containerAction?.validate(name: "\(name).containerAction")
            try self.queryAction?.validate(name: "\(name).queryAction")
        }

        private enum CodingKeys: String, CodingKey {
            case actionName
            case containerAction
            case queryAction
        }
    }

    public struct DatasetActionSummary: AWSDecodableShape {
        /// The name of the action that automatically creates the dataset's contents.
        public let actionName: String?
        /// The type of action by which the dataset's contents are automatically created.
        public let actionType: DatasetActionType?

        public init(actionName: String? = nil, actionType: DatasetActionType? = nil) {
            self.actionName = actionName
            self.actionType = actionType
        }

        private enum CodingKeys: String, CodingKey {
            case actionName
            case actionType
        }
    }

    public struct DatasetContentDeliveryDestination: AWSEncodableShape & AWSDecodableShape {
        /// Configuration information for delivery of dataset contents to IoT Events.
        public let iotEventsDestinationConfiguration: IotEventsDestinationConfiguration?
        /// Configuration information for delivery of dataset contents to Amazon S3.
        public let s3DestinationConfiguration: S3DestinationConfiguration?

        public init(iotEventsDestinationConfiguration: IotEventsDestinationConfiguration? = nil, s3DestinationConfiguration: S3DestinationConfiguration? = nil) {
            self.iotEventsDestinationConfiguration = iotEventsDestinationConfiguration
            self.s3DestinationConfiguration = s3DestinationConfiguration
        }

        public func validate(name: String) throws {
            try self.iotEventsDestinationConfiguration?.validate(name: "\(name).iotEventsDestinationConfiguration")
            try self.s3DestinationConfiguration?.validate(name: "\(name).s3DestinationConfiguration")
        }

        private enum CodingKeys: String, CodingKey {
            case iotEventsDestinationConfiguration
            case s3DestinationConfiguration
        }
    }

    public struct DatasetContentDeliveryRule: AWSEncodableShape & AWSDecodableShape {
        /// The destination to which dataset contents are delivered.
        public let destination: DatasetContentDeliveryDestination
        /// The name of the dataset content delivery rules entry.
        public let entryName: String?

        public init(destination: DatasetContentDeliveryDestination, entryName: String? = nil) {
            self.destination = destination
            self.entryName = entryName
        }

        public func validate(name: String) throws {
            try self.destination.validate(name: "\(name).destination")
        }

        private enum CodingKeys: String, CodingKey {
            case destination
            case entryName
        }
    }

    public struct DatasetContentStatus: AWSDecodableShape {
        /// The reason the dataset contents are in this state.
        public let reason: String?
        /// The state of the dataset contents. Can be one of READY, CREATING, SUCCEEDED, or FAILED.
        public let state: DatasetContentState?

        public init(reason: String? = nil, state: DatasetContentState? = nil) {
            self.reason = reason
            self.state = state
        }

        private enum CodingKeys: String, CodingKey {
            case reason
            case state
        }
    }

    public struct DatasetContentSummary: AWSDecodableShape {
        /// The time the dataset content status was updated to SUCCEEDED or FAILED.
        public let completionTime: Date?
        /// The actual time the creation of the dataset contents was started.
        public let creationTime: Date?
        /// The time the creation of the dataset contents was scheduled to start.
        public let scheduleTime: Date?
        /// The status of the dataset contents.
        public let status: DatasetContentStatus?
        /// The version of the dataset contents.
        public let version: String?

        public init(completionTime: Date? = nil, creationTime: Date? = nil, scheduleTime: Date? = nil, status: DatasetContentStatus? = nil, version: String? = nil) {
            self.completionTime = completionTime
            self.creationTime = creationTime
            self.scheduleTime = scheduleTime
            self.status = status
            self.version = version
        }

        private enum CodingKeys: String, CodingKey {
            case completionTime
            case creationTime
            case scheduleTime
            case status
            case version
        }
    }

    public struct DatasetContentVersionValue: AWSEncodableShape & AWSDecodableShape {
        /// The name of the dataset whose latest contents are used as input to the notebook or application.
        public let datasetName: String

        public init(datasetName: String) {
            self.datasetName = datasetName
        }

        public func validate(name: String) throws {
            try self.validate(self.datasetName, name: "datasetName", parent: name, max: 128)
            try self.validate(self.datasetName, name: "datasetName", parent: name, min: 1)
            try self.validate(self.datasetName, name: "datasetName", parent: name, pattern: "^(^(?!_{2}))(^[a-zA-Z0-9_]+$)$")
        }

        private enum CodingKeys: String, CodingKey {
            case datasetName
        }
    }

    public struct DatasetEntry: AWSDecodableShape {
        /// The presigned URI of the dataset item.
        public let dataURI: String?
        /// The name of the dataset item.
        public let entryName: String?

        public init(dataURI: String? = nil, entryName: String? = nil) {
            self.dataURI = dataURI
            self.entryName = entryName
        }

        private enum CodingKeys: String, CodingKey {
            case dataURI
            case entryName
        }
    }

    public struct DatasetSummary: AWSDecodableShape {
        /// A list of DataActionSummary objects.
        public let actions: [DatasetActionSummary]?
        /// The time the dataset was created.
        public let creationTime: Date?
        /// The name of the dataset.
        public let datasetName: String?
        /// The last time the dataset was updated.
        public let lastUpdateTime: Date?
        /// The status of the dataset.
        public let status: DatasetStatus?
        /// A list of triggers. A trigger causes dataset content to be populated at a specified time interval or when another dataset is populated. The list of triggers can be empty or contain up to five DataSetTrigger objects
        public let triggers: [DatasetTrigger]?

        public init(actions: [DatasetActionSummary]? = nil, creationTime: Date? = nil, datasetName: String? = nil, lastUpdateTime: Date? = nil, status: DatasetStatus? = nil, triggers: [DatasetTrigger]? = nil) {
            self.actions = actions
            self.creationTime = creationTime
            self.datasetName = datasetName
            self.lastUpdateTime = lastUpdateTime
            self.status = status
            self.triggers = triggers
        }

        private enum CodingKeys: String, CodingKey {
            case actions
            case creationTime
            case datasetName
            case lastUpdateTime
            case status
            case triggers
        }
    }

    public struct DatasetTrigger: AWSEncodableShape & AWSDecodableShape {
        /// The dataset whose content creation triggers the creation of this dataset's contents.
        public let dataset: TriggeringDataset?
        /// The Schedule when the trigger is initiated.
        public let schedule: Schedule?

        public init(dataset: TriggeringDataset? = nil, schedule: Schedule? = nil) {
            self.dataset = dataset
            self.schedule = schedule
        }

        public func validate(name: String) throws {
            try self.dataset?.validate(name: "\(name).dataset")
        }

        private enum CodingKeys: String, CodingKey {
            case dataset
            case schedule
        }
    }

    public struct Datastore: AWSDecodableShape {
        /// The ARN of the data store.
        public let arn: String?
        /// When the data store was created.
        public let creationTime: Date?
        ///  Contains information about the partition dimensions in a data store.
        public let datastorePartitions: DatastorePartitions?
        /// Contains the configuration information of file formats.  IoT Analytics data stores support JSON and Parquet.  The default file format is JSON. You can specify only one format.  You can't change the file format after you create the data store.
        public let fileFormatConfiguration: FileFormatConfiguration?
        /// The last time when a new message arrived in the data store.  IoT Analytics updates this value at most once per minute for Amazon Simple Storage Service one data store. Hence, the lastMessageArrivalTime value is an approximation.  This feature only applies to messages that arrived in the data store after October 23, 2020.
        public let lastMessageArrivalTime: Date?
        /// The last time the data store was updated.
        public let lastUpdateTime: Date?
        /// The name of the data store.
        public let name: String?
        /// How long, in days, message data is kept for the data store. When customerManagedS3 storage is selected, this parameter is ignored.
        public let retentionPeriod: RetentionPeriod?
        /// The status of a data store:  CREATING  The data store is being created.  ACTIVE  The data store has been created and can be used.  DELETING  The data store is being deleted.
        public let status: DatastoreStatus?
        /// Where data in a data store is stored.. You can choose serviceManagedS3 storage, customerManagedS3 storage, or iotSiteWiseMultiLayerStorage storage. The default is serviceManagedS3. You can't change the choice of Amazon S3 storage after your data store is created.
        public let storage: DatastoreStorage?

        public init(arn: String? = nil, creationTime: Date? = nil, datastorePartitions: DatastorePartitions? = nil, fileFormatConfiguration: FileFormatConfiguration? = nil, lastMessageArrivalTime: Date? = nil, lastUpdateTime: Date? = nil, name: String? = nil, retentionPeriod: RetentionPeriod? = nil, status: DatastoreStatus? = nil, storage: DatastoreStorage? = nil) {
            self.arn = arn
            self.creationTime = creationTime
            self.datastorePartitions = datastorePartitions
            self.fileFormatConfiguration = fileFormatConfiguration
            self.lastMessageArrivalTime = lastMessageArrivalTime
            self.lastUpdateTime = lastUpdateTime
            self.name = name
            self.retentionPeriod = retentionPeriod
            self.status = status
            self.storage = storage
        }

        private enum CodingKeys: String, CodingKey {
            case arn
            case creationTime
            case datastorePartitions
            case fileFormatConfiguration
            case lastMessageArrivalTime
            case lastUpdateTime
            case name
            case retentionPeriod
            case status
            case storage
        }
    }

    public struct DatastoreActivity: AWSEncodableShape & AWSDecodableShape {
        /// The name of the data store where processed messages are stored.
        public let datastoreName: String
        /// The name of the datastore activity.
        public let name: String

        public init(datastoreName: String, name: String) {
            self.datastoreName = datastoreName
            self.name = name
        }

        public func validate(name: String) throws {
            try self.validate(self.datastoreName, name: "datastoreName", parent: name, max: 128)
            try self.validate(self.datastoreName, name: "datastoreName", parent: name, min: 1)
            try self.validate(self.datastoreName, name: "datastoreName", parent: name, pattern: "^(^(?!_{2}))(^[a-zA-Z0-9_]+$)$")
            try self.validate(self.name, name: "name", parent: name, max: 128)
            try self.validate(self.name, name: "name", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case datastoreName
            case name
        }
    }

    public struct DatastoreIotSiteWiseMultiLayerStorage: AWSEncodableShape & AWSDecodableShape {
        ///  Used to store data used by IoT SiteWise in an Amazon S3 bucket that you manage.
        public let customerManagedS3Storage: IotSiteWiseCustomerManagedDatastoreS3Storage

        public init(customerManagedS3Storage: IotSiteWiseCustomerManagedDatastoreS3Storage) {
            self.customerManagedS3Storage = customerManagedS3Storage
        }

        public func validate(name: String) throws {
            try self.customerManagedS3Storage.validate(name: "\(name).customerManagedS3Storage")
        }

        private enum CodingKeys: String, CodingKey {
            case customerManagedS3Storage
        }
    }

    public struct DatastoreIotSiteWiseMultiLayerStorageSummary: AWSDecodableShape {
        /// Used to store data used by IoT SiteWise in an Amazon S3 bucket that you manage.
        public let customerManagedS3Storage: IotSiteWiseCustomerManagedDatastoreS3StorageSummary?

        public init(customerManagedS3Storage: IotSiteWiseCustomerManagedDatastoreS3StorageSummary? = nil) {
            self.customerManagedS3Storage = customerManagedS3Storage
        }

        private enum CodingKeys: String, CodingKey {
            case customerManagedS3Storage
        }
    }

    public struct DatastorePartition: AWSEncodableShape & AWSDecodableShape {
        ///  A partition dimension defined by an attributeName.
        public let attributePartition: Partition?
        ///  A partition dimension defined by a timestamp attribute.
        public let timestampPartition: TimestampPartition?

        public init(attributePartition: Partition? = nil, timestampPartition: TimestampPartition? = nil) {
            self.attributePartition = attributePartition
            self.timestampPartition = timestampPartition
        }

        public func validate(name: String) throws {
            try self.attributePartition?.validate(name: "\(name).attributePartition")
            try self.timestampPartition?.validate(name: "\(name).timestampPartition")
        }

        private enum CodingKeys: String, CodingKey {
            case attributePartition
            case timestampPartition
        }
    }

    public struct DatastorePartitions: AWSEncodableShape & AWSDecodableShape {
        ///  A list of partition dimensions in a data store.
        public let partitions: [DatastorePartition]?

        public init(partitions: [DatastorePartition]? = nil) {
            self.partitions = partitions
        }

        public func validate(name: String) throws {
            try self.partitions?.forEach {
                try $0.validate(name: "\(name).partitions[]")
            }
            try self.validate(self.partitions, name: "partitions", parent: name, max: 25)
        }

        private enum CodingKeys: String, CodingKey {
            case partitions
        }
    }

    public struct DatastoreStatistics: AWSDecodableShape {
        /// The estimated size of the data store.
        public let size: EstimatedResourceSize?

        public init(size: EstimatedResourceSize? = nil) {
            self.size = size
        }

        private enum CodingKeys: String, CodingKey {
            case size
        }
    }

    public struct DatastoreStorageSummary: AWSDecodableShape {
        /// Used to store data in an Amazon S3 bucket managed by IoT Analytics.
        public let customerManagedS3: CustomerManagedDatastoreS3StorageSummary?
        ///  Used to store data used by IoT SiteWise in an Amazon S3 bucket that you manage.
        public let iotSiteWiseMultiLayerStorage: DatastoreIotSiteWiseMultiLayerStorageSummary?
        /// Used to store data in an Amazon S3 bucket managed by IoT Analytics.
        public let serviceManagedS3: ServiceManagedDatastoreS3StorageSummary?

        public init(customerManagedS3: CustomerManagedDatastoreS3StorageSummary? = nil, iotSiteWiseMultiLayerStorage: DatastoreIotSiteWiseMultiLayerStorageSummary? = nil, serviceManagedS3: ServiceManagedDatastoreS3StorageSummary? = nil) {
            self.customerManagedS3 = customerManagedS3
            self.iotSiteWiseMultiLayerStorage = iotSiteWiseMultiLayerStorage
            self.serviceManagedS3 = serviceManagedS3
        }

        private enum CodingKeys: String, CodingKey {
            case customerManagedS3
            case iotSiteWiseMultiLayerStorage
            case serviceManagedS3
        }
    }

    public struct DatastoreSummary: AWSDecodableShape {
        /// When the data store was created.
        public let creationTime: Date?
        /// The name of the data store.
        public let datastoreName: String?
        ///  Contains information about the partition dimensions in a data store.
        public let datastorePartitions: DatastorePartitions?
        /// Where data in a data store is stored.
        public let datastoreStorage: DatastoreStorageSummary?
        /// The file format of the data in the data store.
        public let fileFormatType: FileFormatType?
        /// The last time when a new message arrived in the data store.  IoT Analytics updates this value at most once per minute for Amazon Simple Storage Service one data store. Hence, the lastMessageArrivalTime value is an approximation.  This feature only applies to messages that arrived in the data store after October 23, 2020.
        public let lastMessageArrivalTime: Date?
        /// The last time the data store was updated.
        public let lastUpdateTime: Date?
        /// The status of the data store.
        public let status: DatastoreStatus?

        public init(creationTime: Date? = nil, datastoreName: String? = nil, datastorePartitions: DatastorePartitions? = nil, datastoreStorage: DatastoreStorageSummary? = nil, fileFormatType: FileFormatType? = nil, lastMessageArrivalTime: Date? = nil, lastUpdateTime: Date? = nil, status: DatastoreStatus? = nil) {
            self.creationTime = creationTime
            self.datastoreName = datastoreName
            self.datastorePartitions = datastorePartitions
            self.datastoreStorage = datastoreStorage
            self.fileFormatType = fileFormatType
            self.lastMessageArrivalTime = lastMessageArrivalTime
            self.lastUpdateTime = lastUpdateTime
            self.status = status
        }

        private enum CodingKeys: String, CodingKey {
            case creationTime
            case datastoreName
            case datastorePartitions
            case datastoreStorage
            case fileFormatType
            case lastMessageArrivalTime
            case lastUpdateTime
            case status
        }
    }

    public struct DeleteChannelRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "channelName", location: .uri("channelName"))
        ]

        /// The name of the channel to delete.
        public let channelName: String

        public init(channelName: String) {
            self.channelName = channelName
        }

        public func validate(name: String) throws {
            try self.validate(self.channelName, name: "channelName", parent: name, max: 128)
            try self.validate(self.channelName, name: "channelName", parent: name, min: 1)
            try self.validate(self.channelName, name: "channelName", parent: name, pattern: "^(^(?!_{2}))(^[a-zA-Z0-9_]+$)$")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct DeleteDatasetContentRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "datasetName", location: .uri("datasetName")),
            AWSMemberEncoding(label: "versionId", location: .querystring("versionId"))
        ]

        /// The name of the dataset whose content is deleted.
        public let datasetName: String
        /// The version of the dataset whose content is deleted. You can also use the strings "$LATEST" or "$LATEST_SUCCEEDED" to delete the latest or latest successfully completed data set. If not specified, "$LATEST_SUCCEEDED" is the default.
        public let versionId: String?

        public init(datasetName: String, versionId: String? = nil) {
            self.datasetName = datasetName
            self.versionId = versionId
        }

        public func validate(name: String) throws {
            try self.validate(self.datasetName, name: "datasetName", parent: name, max: 128)
            try self.validate(self.datasetName, name: "datasetName", parent: name, min: 1)
            try self.validate(self.datasetName, name: "datasetName", parent: name, pattern: "^(^(?!_{2}))(^[a-zA-Z0-9_]+$)$")
            try self.validate(self.versionId, name: "versionId", parent: name, max: 36)
            try self.validate(self.versionId, name: "versionId", parent: name, min: 7)
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct DeleteDatasetRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "datasetName", location: .uri("datasetName"))
        ]

        /// The name of the dataset to delete.
        public let datasetName: String

        public init(datasetName: String) {
            self.datasetName = datasetName
        }

        public func validate(name: String) throws {
            try self.validate(self.datasetName, name: "datasetName", parent: name, max: 128)
            try self.validate(self.datasetName, name: "datasetName", parent: name, min: 1)
            try self.validate(self.datasetName, name: "datasetName", parent: name, pattern: "^(^(?!_{2}))(^[a-zA-Z0-9_]+$)$")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct DeleteDatastoreRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "datastoreName", location: .uri("datastoreName"))
        ]

        /// The name of the data store to delete.
        public let datastoreName: String

        public init(datastoreName: String) {
            self.datastoreName = datastoreName
        }

        public func validate(name: String) throws {
            try self.validate(self.datastoreName, name: "datastoreName", parent: name, max: 128)
            try self.validate(self.datastoreName, name: "datastoreName", parent: name, min: 1)
            try self.validate(self.datastoreName, name: "datastoreName", parent: name, pattern: "^(^(?!_{2}))(^[a-zA-Z0-9_]+$)$")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct DeletePipelineRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "pipelineName", location: .uri("pipelineName"))
        ]

        /// The name of the pipeline to delete.
        public let pipelineName: String

        public init(pipelineName: String) {
            self.pipelineName = pipelineName
        }

        public func validate(name: String) throws {
            try self.validate(self.pipelineName, name: "pipelineName", parent: name, max: 128)
            try self.validate(self.pipelineName, name: "pipelineName", parent: name, min: 1)
            try self.validate(self.pipelineName, name: "pipelineName", parent: name, pattern: "^(^(?!_{2}))(^[a-zA-Z0-9_]+$)$")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct DeltaTime: AWSEncodableShape & AWSDecodableShape {
        /// The number of seconds of estimated in-flight lag time of message data. When you create dataset contents using message data from a specified timeframe, some message data might still be in flight when processing begins, and so do not arrive in time to be processed. Use this field to make allowances for the in flight time of your message data, so that data not processed from a previous timeframe is included with the next timeframe. Otherwise, missed message data would be excluded from processing during the next timeframe too, because its timestamp places it within the previous timeframe.
        public let offsetSeconds: Int
        /// An expression by which the time of the message data might be determined. This can be the name of a timestamp field or a SQL expression that is used to derive the time the message data was generated.
        public let timeExpression: String

        public init(offsetSeconds: Int, timeExpression: String) {
            self.offsetSeconds = offsetSeconds
            self.timeExpression = timeExpression
        }

        private enum CodingKeys: String, CodingKey {
            case offsetSeconds
            case timeExpression
        }
    }

    public struct DeltaTimeSessionWindowConfiguration: AWSEncodableShape & AWSDecodableShape {
        /// A time interval. You can use timeoutInMinutes so that IoT Analytics can batch up late data notifications that have been generated since the last execution. IoT Analytics sends one batch of notifications to Amazon CloudWatch Events at one time. For more information about how to write a timestamp expression, see Date and Time Functions and Operators, in the Presto 0.172 Documentation.
        public let timeoutInMinutes: Int

        public init(timeoutInMinutes: Int) {
            self.timeoutInMinutes = timeoutInMinutes
        }

        public func validate(name: String) throws {
            try self.validate(self.timeoutInMinutes, name: "timeoutInMinutes", parent: name, max: 60)
            try self.validate(self.timeoutInMinutes, name: "timeoutInMinutes", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case timeoutInMinutes
        }
    }

    public struct DescribeChannelRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "channelName", location: .uri("channelName")),
            AWSMemberEncoding(label: "includeStatistics", location: .querystring("includeStatistics"))
        ]

        /// The name of the channel whose information is retrieved.
        public let channelName: String
        /// If true, additional statistical information about the channel is included in the response. This feature can't be used with a channel whose S3 storage is customer-managed.
        public let includeStatistics: Bool?

        public init(channelName: String, includeStatistics: Bool? = nil) {
            self.channelName = channelName
            self.includeStatistics = includeStatistics
        }

        public func validate(name: String) throws {
            try self.validate(self.channelName, name: "channelName", parent: name, max: 128)
            try self.validate(self.channelName, name: "channelName", parent: name, min: 1)
            try self.validate(self.channelName, name: "channelName", parent: name, pattern: "^(^(?!_{2}))(^[a-zA-Z0-9_]+$)$")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct DescribeChannelResponse: AWSDecodableShape {
        /// An object that contains information about the channel.
        public let channel: Channel?
        /// Statistics about the channel. Included if the includeStatistics parameter is set to true in the request.
        public let statistics: ChannelStatistics?

        public init(channel: Channel? = nil, statistics: ChannelStatistics? = nil) {
            self.channel = channel
            self.statistics = statistics
        }

        private enum CodingKeys: String, CodingKey {
            case channel
            case statistics
        }
    }

    public struct DescribeDatasetRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "datasetName", location: .uri("datasetName"))
        ]

        /// The name of the dataset whose information is retrieved.
        public let datasetName: String

        public init(datasetName: String) {
            self.datasetName = datasetName
        }

        public func validate(name: String) throws {
            try self.validate(self.datasetName, name: "datasetName", parent: name, max: 128)
            try self.validate(self.datasetName, name: "datasetName", parent: name, min: 1)
            try self.validate(self.datasetName, name: "datasetName", parent: name, pattern: "^(^(?!_{2}))(^[a-zA-Z0-9_]+$)$")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct DescribeDatasetResponse: AWSDecodableShape {
        /// An object that contains information about the dataset.
        public let dataset: Dataset?

        public init(dataset: Dataset? = nil) {
            self.dataset = dataset
        }

        private enum CodingKeys: String, CodingKey {
            case dataset
        }
    }

    public struct DescribeDatastoreRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "datastoreName", location: .uri("datastoreName")),
            AWSMemberEncoding(label: "includeStatistics", location: .querystring("includeStatistics"))
        ]

        /// The name of the data store
        public let datastoreName: String
        /// If true, additional statistical information about the data store is included in the response. This feature can't be used with a data store whose S3 storage is customer-managed.
        public let includeStatistics: Bool?

        public init(datastoreName: String, includeStatistics: Bool? = nil) {
            self.datastoreName = datastoreName
            self.includeStatistics = includeStatistics
        }

        public func validate(name: String) throws {
            try self.validate(self.datastoreName, name: "datastoreName", parent: name, max: 128)
            try self.validate(self.datastoreName, name: "datastoreName", parent: name, min: 1)
            try self.validate(self.datastoreName, name: "datastoreName", parent: name, pattern: "^(^(?!_{2}))(^[a-zA-Z0-9_]+$)$")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct DescribeDatastoreResponse: AWSDecodableShape {
        /// Information about the data store.
        public let datastore: Datastore?
        /// Additional statistical information about the data store. Included if the includeStatistics parameter is set to true in the request.
        public let statistics: DatastoreStatistics?

        public init(datastore: Datastore? = nil, statistics: DatastoreStatistics? = nil) {
            self.datastore = datastore
            self.statistics = statistics
        }

        private enum CodingKeys: String, CodingKey {
            case datastore
            case statistics
        }
    }

    public struct DescribeLoggingOptionsRequest: AWSEncodableShape {
        public init() {}
    }

    public struct DescribeLoggingOptionsResponse: AWSDecodableShape {
        /// The current settings of the IoT Analytics logging options.
        public let loggingOptions: LoggingOptions?

        public init(loggingOptions: LoggingOptions? = nil) {
            self.loggingOptions = loggingOptions
        }

        private enum CodingKeys: String, CodingKey {
            case loggingOptions
        }
    }

    public struct DescribePipelineRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "pipelineName", location: .uri("pipelineName"))
        ]

        /// The name of the pipeline whose information is retrieved.
        public let pipelineName: String

        public init(pipelineName: String) {
            self.pipelineName = pipelineName
        }

        public func validate(name: String) throws {
            try self.validate(self.pipelineName, name: "pipelineName", parent: name, max: 128)
            try self.validate(self.pipelineName, name: "pipelineName", parent: name, min: 1)
            try self.validate(self.pipelineName, name: "pipelineName", parent: name, pattern: "^(^(?!_{2}))(^[a-zA-Z0-9_]+$)$")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct DescribePipelineResponse: AWSDecodableShape {
        /// A Pipeline object that contains information about the pipeline.
        public let pipeline: Pipeline?

        public init(pipeline: Pipeline? = nil) {
            self.pipeline = pipeline
        }

        private enum CodingKeys: String, CodingKey {
            case pipeline
        }
    }

    public struct DeviceRegistryEnrichActivity: AWSEncodableShape & AWSDecodableShape {
        /// The name of the attribute that is added to the message.
        public let attribute: String
        /// The name of the deviceRegistryEnrich activity.
        public let name: String
        /// The next activity in the pipeline.
        public let next: String?
        /// The ARN of the role that allows access to the device's registry information.
        public let roleArn: String
        /// The name of the IoT device whose registry information is added to the message.
        public let thingName: String

        public init(attribute: String, name: String, next: String? = nil, roleArn: String, thingName: String) {
            self.attribute = attribute
            self.name = name
            self.next = next
            self.roleArn = roleArn
            self.thingName = thingName
        }

        public func validate(name: String) throws {
            try self.validate(self.attribute, name: "attribute", parent: name, max: 256)
            try self.validate(self.attribute, name: "attribute", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, max: 128)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.next, name: "next", parent: name, max: 128)
            try self.validate(self.next, name: "next", parent: name, min: 1)
            try self.validate(self.roleArn, name: "roleArn", parent: name, max: 2048)
            try self.validate(self.roleArn, name: "roleArn", parent: name, min: 20)
            try self.validate(self.thingName, name: "thingName", parent: name, max: 256)
            try self.validate(self.thingName, name: "thingName", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case attribute
            case name
            case next
            case roleArn
            case thingName
        }
    }

    public struct DeviceShadowEnrichActivity: AWSEncodableShape & AWSDecodableShape {
        /// The name of the attribute that is added to the message.
        public let attribute: String
        /// The name of the deviceShadowEnrich activity.
        public let name: String
        /// The next activity in the pipeline.
        public let next: String?
        /// The ARN of the role that allows access to the device's shadow.
        public let roleArn: String
        /// The name of the IoT device whose shadow information is added to the message.
        public let thingName: String

        public init(attribute: String, name: String, next: String? = nil, roleArn: String, thingName: String) {
            self.attribute = attribute
            self.name = name
            self.next = next
            self.roleArn = roleArn
            self.thingName = thingName
        }

        public func validate(name: String) throws {
            try self.validate(self.attribute, name: "attribute", parent: name, max: 256)
            try self.validate(self.attribute, name: "attribute", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, max: 128)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.next, name: "next", parent: name, max: 128)
            try self.validate(self.next, name: "next", parent: name, min: 1)
            try self.validate(self.roleArn, name: "roleArn", parent: name, max: 2048)
            try self.validate(self.roleArn, name: "roleArn", parent: name, min: 20)
            try self.validate(self.thingName, name: "thingName", parent: name, max: 256)
            try self.validate(self.thingName, name: "thingName", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case attribute
            case name
            case next
            case roleArn
            case thingName
        }
    }

    public struct EstimatedResourceSize: AWSDecodableShape {
        /// The time when the estimate of the size of the resource was made.
        public let estimatedOn: Date?
        /// The estimated size of the resource, in bytes.
        public let estimatedSizeInBytes: Double?

        public init(estimatedOn: Date? = nil, estimatedSizeInBytes: Double? = nil) {
            self.estimatedOn = estimatedOn
            self.estimatedSizeInBytes = estimatedSizeInBytes
        }

        private enum CodingKeys: String, CodingKey {
            case estimatedOn
            case estimatedSizeInBytes
        }
    }

    public struct FileFormatConfiguration: AWSEncodableShape & AWSDecodableShape {
        /// Contains the configuration information of the JSON format.
        public let jsonConfiguration: JsonConfiguration?
        /// Contains the configuration information of the Parquet format.
        public let parquetConfiguration: ParquetConfiguration?

        public init(jsonConfiguration: JsonConfiguration? = nil, parquetConfiguration: ParquetConfiguration? = nil) {
            self.jsonConfiguration = jsonConfiguration
            self.parquetConfiguration = parquetConfiguration
        }

        public func validate(name: String) throws {
            try self.parquetConfiguration?.validate(name: "\(name).parquetConfiguration")
        }

        private enum CodingKeys: String, CodingKey {
            case jsonConfiguration
            case parquetConfiguration
        }
    }

    public struct FilterActivity: AWSEncodableShape & AWSDecodableShape {
        /// An expression that looks like a SQL WHERE clause that must return a Boolean value. Messages that satisfy the condition are passed to the next activity.
        public let filter: String
        /// The name of the filter activity.
        public let name: String
        /// The next activity in the pipeline.
        public let next: String?

        public init(filter: String, name: String, next: String? = nil) {
            self.filter = filter
            self.name = name
            self.next = next
        }

        public func validate(name: String) throws {
            try self.validate(self.filter, name: "filter", parent: name, max: 256)
            try self.validate(self.filter, name: "filter", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, max: 128)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.next, name: "next", parent: name, max: 128)
            try self.validate(self.next, name: "next", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case filter
            case name
            case next
        }
    }

    public struct GetDatasetContentRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "datasetName", location: .uri("datasetName")),
            AWSMemberEncoding(label: "versionId", location: .querystring("versionId"))
        ]

        /// The name of the dataset whose contents are retrieved.
        public let datasetName: String
        /// The version of the dataset whose contents are retrieved. You can also use the strings "$LATEST" or "$LATEST_SUCCEEDED" to retrieve the contents of the latest or latest successfully completed dataset. If not specified, "$LATEST_SUCCEEDED" is the default.
        public let versionId: String?

        public init(datasetName: String, versionId: String? = nil) {
            self.datasetName = datasetName
            self.versionId = versionId
        }

        public func validate(name: String) throws {
            try self.validate(self.datasetName, name: "datasetName", parent: name, max: 128)
            try self.validate(self.datasetName, name: "datasetName", parent: name, min: 1)
            try self.validate(self.datasetName, name: "datasetName", parent: name, pattern: "^(^(?!_{2}))(^[a-zA-Z0-9_]+$)$")
            try self.validate(self.versionId, name: "versionId", parent: name, max: 36)
            try self.validate(self.versionId, name: "versionId", parent: name, min: 7)
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct GetDatasetContentResponse: AWSDecodableShape {
        /// A list of DatasetEntry objects.
        public let entries: [DatasetEntry]?
        /// The status of the dataset content.
        public let status: DatasetContentStatus?
        /// The time when the request was made.
        public let timestamp: Date?

        public init(entries: [DatasetEntry]? = nil, status: DatasetContentStatus? = nil, timestamp: Date? = nil) {
            self.entries = entries
            self.status = status
            self.timestamp = timestamp
        }

        private enum CodingKeys: String, CodingKey {
            case entries
            case status
            case timestamp
        }
    }

    public struct GlueConfiguration: AWSEncodableShape & AWSDecodableShape {
        /// The name of the database in your Glue Data Catalog in which the table is located. An Glue Data Catalog database contains metadata tables.
        public let databaseName: String
        /// The name of the table in your Glue Data Catalog that is used to perform the ETL operations. An Glue Data Catalog table contains partitioned data and descriptions of data sources and targets.
        public let tableName: String

        public init(databaseName: String, tableName: String) {
            self.databaseName = databaseName
            self.tableName = tableName
        }

        public func validate(name: String) throws {
            try self.validate(self.databaseName, name: "databaseName", parent: name, max: 150)
            try self.validate(self.databaseName, name: "databaseName", parent: name, min: 1)
            try self.validate(self.databaseName, name: "databaseName", parent: name, pattern: "^[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\t]*$")
            try self.validate(self.tableName, name: "tableName", parent: name, max: 150)
            try self.validate(self.tableName, name: "tableName", parent: name, min: 1)
            try self.validate(self.tableName, name: "tableName", parent: name, pattern: "^[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\t]*$")
        }

        private enum CodingKeys: String, CodingKey {
            case databaseName
            case tableName
        }
    }

    public struct IotEventsDestinationConfiguration: AWSEncodableShape & AWSDecodableShape {
        /// The name of the IoT Events input to which dataset contents are delivered.
        public let inputName: String
        /// The ARN of the role that grants IoT Analytics permission to deliver dataset contents to an IoT Events input.
        public let roleArn: String

        public init(inputName: String, roleArn: String) {
            self.inputName = inputName
            self.roleArn = roleArn
        }

        public func validate(name: String) throws {
            try self.validate(self.inputName, name: "inputName", parent: name, max: 128)
            try self.validate(self.inputName, name: "inputName", parent: name, min: 1)
            try self.validate(self.inputName, name: "inputName", parent: name, pattern: "^[a-zA-Z][a-zA-Z0-9_]*$")
            try self.validate(self.roleArn, name: "roleArn", parent: name, max: 2048)
            try self.validate(self.roleArn, name: "roleArn", parent: name, min: 20)
        }

        private enum CodingKeys: String, CodingKey {
            case inputName
            case roleArn
        }
    }

    public struct IotSiteWiseCustomerManagedDatastoreS3Storage: AWSEncodableShape & AWSDecodableShape {
        ///  The name of the Amazon S3 bucket where your data is stored.
        public let bucket: String
        ///  (Optional) The prefix used to create the keys of the data store data objects. Each object in an Amazon S3 bucket has a key that is its unique identifier in the bucket. Each object in a bucket has exactly one key. The prefix must end with a forward slash (/).
        public let keyPrefix: String?

        public init(bucket: String, keyPrefix: String? = nil) {
            self.bucket = bucket
            self.keyPrefix = keyPrefix
        }

        public func validate(name: String) throws {
            try self.validate(self.bucket, name: "bucket", parent: name, max: 255)
            try self.validate(self.bucket, name: "bucket", parent: name, min: 3)
            try self.validate(self.bucket, name: "bucket", parent: name, pattern: "^[a-zA-Z0-9.\\-_]*$")
            try self.validate(self.keyPrefix, name: "keyPrefix", parent: name, max: 255)
            try self.validate(self.keyPrefix, name: "keyPrefix", parent: name, min: 1)
            try self.validate(self.keyPrefix, name: "keyPrefix", parent: name, pattern: "^[a-zA-Z0-9!_.*'()/{}:-]*/$")
        }

        private enum CodingKeys: String, CodingKey {
            case bucket
            case keyPrefix
        }
    }

    public struct IotSiteWiseCustomerManagedDatastoreS3StorageSummary: AWSDecodableShape {
        ///  The name of the Amazon S3 bucket where your data is stored.
        public let bucket: String?
        ///  (Optional) The prefix used to create the keys of the data store data objects. Each object in an Amazon S3 bucket has a key that is its unique identifier in the bucket. Each object in a bucket has exactly one key. The prefix must end with a forward slash (/).
        public let keyPrefix: String?

        public init(bucket: String? = nil, keyPrefix: String? = nil) {
            self.bucket = bucket
            self.keyPrefix = keyPrefix
        }

        private enum CodingKeys: String, CodingKey {
            case bucket
            case keyPrefix
        }
    }

    public struct JsonConfiguration: AWSEncodableShape & AWSDecodableShape {
        public init() {}
    }

    public struct LambdaActivity: AWSEncodableShape & AWSDecodableShape {
        /// The number of messages passed to the Lambda function for processing. The Lambda function must be able to process all of these messages within five minutes, which is the maximum timeout duration for Lambda functions.
        public let batchSize: Int
        /// The name of the Lambda function that is run on the message.
        public let lambdaName: String
        /// The name of the lambda activity.
        public let name: String
        /// The next activity in the pipeline.
        public let next: String?

        public init(batchSize: Int, lambdaName: String, name: String, next: String? = nil) {
            self.batchSize = batchSize
            self.lambdaName = lambdaName
            self.name = name
            self.next = next
        }

        public func validate(name: String) throws {
            try self.validate(self.batchSize, name: "batchSize", parent: name, max: 1000)
            try self.validate(self.batchSize, name: "batchSize", parent: name, min: 1)
            try self.validate(self.lambdaName, name: "lambdaName", parent: name, max: 64)
            try self.validate(self.lambdaName, name: "lambdaName", parent: name, min: 1)
            try self.validate(self.lambdaName, name: "lambdaName", parent: name, pattern: "^[a-zA-Z0-9_-]+$")
            try self.validate(self.name, name: "name", parent: name, max: 128)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.next, name: "next", parent: name, max: 128)
            try self.validate(self.next, name: "next", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case batchSize
            case lambdaName
            case name
            case next
        }
    }

    public struct LateDataRule: AWSEncodableShape & AWSDecodableShape {
        /// The information needed to configure the late data rule.
        public let ruleConfiguration: LateDataRuleConfiguration
        /// The name of the late data rule.
        public let ruleName: String?

        public init(ruleConfiguration: LateDataRuleConfiguration, ruleName: String? = nil) {
            self.ruleConfiguration = ruleConfiguration
            self.ruleName = ruleName
        }

        public func validate(name: String) throws {
            try self.ruleConfiguration.validate(name: "\(name).ruleConfiguration")
            try self.validate(self.ruleName, name: "ruleName", parent: name, max: 128)
            try self.validate(self.ruleName, name: "ruleName", parent: name, min: 1)
            try self.validate(self.ruleName, name: "ruleName", parent: name, pattern: "^[a-zA-Z0-9_]+$")
        }

        private enum CodingKeys: String, CodingKey {
            case ruleConfiguration
            case ruleName
        }
    }

    public struct LateDataRuleConfiguration: AWSEncodableShape & AWSDecodableShape {
        /// The information needed to configure a delta time session window.
        public let deltaTimeSessionWindowConfiguration: DeltaTimeSessionWindowConfiguration?

        public init(deltaTimeSessionWindowConfiguration: DeltaTimeSessionWindowConfiguration? = nil) {
            self.deltaTimeSessionWindowConfiguration = deltaTimeSessionWindowConfiguration
        }

        public func validate(name: String) throws {
            try self.deltaTimeSessionWindowConfiguration?.validate(name: "\(name).deltaTimeSessionWindowConfiguration")
        }

        private enum CodingKeys: String, CodingKey {
            case deltaTimeSessionWindowConfiguration
        }
    }

    public struct ListChannelsRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "maxResults", location: .querystring("maxResults")),
            AWSMemberEncoding(label: "nextToken", location: .querystring("nextToken"))
        ]

        /// The maximum number of results to return in this request. The default value is 100.
        public let maxResults: Int?
        /// The token for the next set of results.
        public let nextToken: String?

        public init(maxResults: Int? = nil, nextToken: String? = nil) {
            self.maxResults = maxResults
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 250)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct ListChannelsResponse: AWSDecodableShape {
        /// A list of ChannelSummary objects.
        public let channelSummaries: [ChannelSummary]?
        /// The token to retrieve the next set of results, or null if there are no more results.
        public let nextToken: String?

        public init(channelSummaries: [ChannelSummary]? = nil, nextToken: String? = nil) {
            self.channelSummaries = channelSummaries
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case channelSummaries
            case nextToken
        }
    }

    public struct ListDatasetContentsRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "datasetName", location: .uri("datasetName")),
            AWSMemberEncoding(label: "maxResults", location: .querystring("maxResults")),
            AWSMemberEncoding(label: "nextToken", location: .querystring("nextToken")),
            AWSMemberEncoding(label: "scheduledBefore", location: .querystring("scheduledBefore")),
            AWSMemberEncoding(label: "scheduledOnOrAfter", location: .querystring("scheduledOnOrAfter"))
        ]

        /// The name of the dataset whose contents information you want to list.
        public let datasetName: String
        /// The maximum number of results to return in this request.
        public let maxResults: Int?
        /// The token for the next set of results.
        public let nextToken: String?
        /// A filter to limit results to those dataset contents whose creation is scheduled before the given time. See the field triggers.schedule in the CreateDataset request. (timestamp)
        public let scheduledBefore: Date?
        /// A filter to limit results to those dataset contents whose creation is scheduled on or after the given time. See the field triggers.schedule in the CreateDataset request. (timestamp)
        public let scheduledOnOrAfter: Date?

        public init(datasetName: String, maxResults: Int? = nil, nextToken: String? = nil, scheduledBefore: Date? = nil, scheduledOnOrAfter: Date? = nil) {
            self.datasetName = datasetName
            self.maxResults = maxResults
            self.nextToken = nextToken
            self.scheduledBefore = scheduledBefore
            self.scheduledOnOrAfter = scheduledOnOrAfter
        }

        public func validate(name: String) throws {
            try self.validate(self.datasetName, name: "datasetName", parent: name, max: 128)
            try self.validate(self.datasetName, name: "datasetName", parent: name, min: 1)
            try self.validate(self.datasetName, name: "datasetName", parent: name, pattern: "^(^(?!_{2}))(^[a-zA-Z0-9_]+$)$")
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 250)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct ListDatasetContentsResponse: AWSDecodableShape {
        /// Summary information about dataset contents that have been created.
        public let datasetContentSummaries: [DatasetContentSummary]?
        /// The token to retrieve the next set of results, or null if there are no more results.
        public let nextToken: String?

        public init(datasetContentSummaries: [DatasetContentSummary]? = nil, nextToken: String? = nil) {
            self.datasetContentSummaries = datasetContentSummaries
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case datasetContentSummaries
            case nextToken
        }
    }

    public struct ListDatasetsRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "maxResults", location: .querystring("maxResults")),
            AWSMemberEncoding(label: "nextToken", location: .querystring("nextToken"))
        ]

        /// The maximum number of results to return in this request. The default value is 100.
        public let maxResults: Int?
        /// The token for the next set of results.
        public let nextToken: String?

        public init(maxResults: Int? = nil, nextToken: String? = nil) {
            self.maxResults = maxResults
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 250)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct ListDatasetsResponse: AWSDecodableShape {
        /// A list of DatasetSummary objects.
        public let datasetSummaries: [DatasetSummary]?
        /// The token to retrieve the next set of results, or null if there are no more results.
        public let nextToken: String?

        public init(datasetSummaries: [DatasetSummary]? = nil, nextToken: String? = nil) {
            self.datasetSummaries = datasetSummaries
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case datasetSummaries
            case nextToken
        }
    }

    public struct ListDatastoresRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "maxResults", location: .querystring("maxResults")),
            AWSMemberEncoding(label: "nextToken", location: .querystring("nextToken"))
        ]

        /// The maximum number of results to return in this request. The default value is 100.
        public let maxResults: Int?
        /// The token for the next set of results.
        public let nextToken: String?

        public init(maxResults: Int? = nil, nextToken: String? = nil) {
            self.maxResults = maxResults
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 250)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct ListDatastoresResponse: AWSDecodableShape {
        /// A list of DatastoreSummary objects.
        public let datastoreSummaries: [DatastoreSummary]?
        /// The token to retrieve the next set of results, or null if there are no more results.
        public let nextToken: String?

        public init(datastoreSummaries: [DatastoreSummary]? = nil, nextToken: String? = nil) {
            self.datastoreSummaries = datastoreSummaries
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case datastoreSummaries
            case nextToken
        }
    }

    public struct ListPipelinesRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "maxResults", location: .querystring("maxResults")),
            AWSMemberEncoding(label: "nextToken", location: .querystring("nextToken"))
        ]

        /// The maximum number of results to return in this request. The default value is 100.
        public let maxResults: Int?
        /// The token for the next set of results.
        public let nextToken: String?

        public init(maxResults: Int? = nil, nextToken: String? = nil) {
            self.maxResults = maxResults
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 250)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct ListPipelinesResponse: AWSDecodableShape {
        /// The token to retrieve the next set of results, or null if there are no more results.
        public let nextToken: String?
        /// A list of PipelineSummary objects.
        public let pipelineSummaries: [PipelineSummary]?

        public init(nextToken: String? = nil, pipelineSummaries: [PipelineSummary]? = nil) {
            self.nextToken = nextToken
            self.pipelineSummaries = pipelineSummaries
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken
            case pipelineSummaries
        }
    }

    public struct ListTagsForResourceRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "resourceArn", location: .querystring("resourceArn"))
        ]

        /// The ARN of the resource whose tags you want to list.
        public let resourceArn: String

        public init(resourceArn: String) {
            self.resourceArn = resourceArn
        }

        public func validate(name: String) throws {
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, max: 2048)
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, min: 20)
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct ListTagsForResourceResponse: AWSDecodableShape {
        /// The tags (metadata) that you have assigned to the resource.
        public let tags: [Tag]?

        public init(tags: [Tag]? = nil) {
            self.tags = tags
        }

        private enum CodingKeys: String, CodingKey {
            case tags
        }
    }

    public struct LoggingOptions: AWSEncodableShape & AWSDecodableShape {
        /// If true, logging is enabled for IoT Analytics.
        public let enabled: Bool
        /// The logging level. Currently, only ERROR is supported.
        public let level: LoggingLevel
        /// The ARN of the role that grants permission to IoT Analytics to perform logging.
        public let roleArn: String

        public init(enabled: Bool, level: LoggingLevel, roleArn: String) {
            self.enabled = enabled
            self.level = level
            self.roleArn = roleArn
        }

        public func validate(name: String) throws {
            try self.validate(self.roleArn, name: "roleArn", parent: name, max: 2048)
            try self.validate(self.roleArn, name: "roleArn", parent: name, min: 20)
        }

        private enum CodingKeys: String, CodingKey {
            case enabled
            case level
            case roleArn
        }
    }

    public struct MathActivity: AWSEncodableShape & AWSDecodableShape {
        /// The name of the attribute that contains the result of the math operation.
        public let attribute: String
        /// An expression that uses one or more existing attributes and must return an integer value.
        public let math: String
        /// The name of the math activity.
        public let name: String
        /// The next activity in the pipeline.
        public let next: String?

        public init(attribute: String, math: String, name: String, next: String? = nil) {
            self.attribute = attribute
            self.math = math
            self.name = name
            self.next = next
        }

        public func validate(name: String) throws {
            try self.validate(self.attribute, name: "attribute", parent: name, max: 256)
            try self.validate(self.attribute, name: "attribute", parent: name, min: 1)
            try self.validate(self.math, name: "math", parent: name, max: 256)
            try self.validate(self.math, name: "math", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, max: 128)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.next, name: "next", parent: name, max: 128)
            try self.validate(self.next, name: "next", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case attribute
            case math
            case name
            case next
        }
    }

    public struct Message: AWSEncodableShape {
        /// The ID you want to assign to the message. Each messageId must be unique within each batch sent.
        public let messageId: String
        /// The payload of the message. This can be a JSON string or a base64-encoded string representing binary data, in which case you must decode it by means of a pipeline activity.
        public let payload: AWSBase64Data

        public init(messageId: String, payload: AWSBase64Data) {
            self.messageId = messageId
            self.payload = payload
        }

        public func validate(name: String) throws {
            try self.validate(self.messageId, name: "messageId", parent: name, max: 128)
            try self.validate(self.messageId, name: "messageId", parent: name, min: 1)
            try self.validate(self.messageId, name: "messageId", parent: name, pattern: "^\\p{ASCII}*$")
        }

        private enum CodingKeys: String, CodingKey {
            case messageId
            case payload
        }
    }

    public struct OutputFileUriValue: AWSEncodableShape & AWSDecodableShape {
        /// The URI of the location where dataset contents are stored, usually the URI of a file in an S3 bucket.
        public let fileName: String

        public init(fileName: String) {
            self.fileName = fileName
        }

        public func validate(name: String) throws {
            try self.validate(self.fileName, name: "fileName", parent: name, pattern: "^[\\w\\.-]{1,255}$")
        }

        private enum CodingKeys: String, CodingKey {
            case fileName
        }
    }

    public struct ParquetConfiguration: AWSEncodableShape & AWSDecodableShape {
        /// Information needed to define a schema.
        public let schemaDefinition: SchemaDefinition?

        public init(schemaDefinition: SchemaDefinition? = nil) {
            self.schemaDefinition = schemaDefinition
        }

        public func validate(name: String) throws {
            try self.schemaDefinition?.validate(name: "\(name).schemaDefinition")
        }

        private enum CodingKeys: String, CodingKey {
            case schemaDefinition
        }
    }

    public struct Partition: AWSEncodableShape & AWSDecodableShape {
        ///  The name of the attribute that defines a partition dimension.
        public let attributeName: String

        public init(attributeName: String) {
            self.attributeName = attributeName
        }

        public func validate(name: String) throws {
            try self.validate(self.attributeName, name: "attributeName", parent: name, max: 128)
            try self.validate(self.attributeName, name: "attributeName", parent: name, min: 1)
            try self.validate(self.attributeName, name: "attributeName", parent: name, pattern: "^[a-zA-Z0-9_]+$")
        }

        private enum CodingKeys: String, CodingKey {
            case attributeName
        }
    }

    public struct Pipeline: AWSDecodableShape {
        /// The activities that perform transformations on the messages.
        public let activities: [PipelineActivity]?
        /// The ARN of the pipeline.
        public let arn: String?
        /// When the pipeline was created.
        public let creationTime: Date?
        /// The last time the pipeline was updated.
        public let lastUpdateTime: Date?
        /// The name of the pipeline.
        public let name: String?
        /// A summary of information about the pipeline reprocessing.
        public let reprocessingSummaries: [ReprocessingSummary]?

        public init(activities: [PipelineActivity]? = nil, arn: String? = nil, creationTime: Date? = nil, lastUpdateTime: Date? = nil, name: String? = nil, reprocessingSummaries: [ReprocessingSummary]? = nil) {
            self.activities = activities
            self.arn = arn
            self.creationTime = creationTime
            self.lastUpdateTime = lastUpdateTime
            self.name = name
            self.reprocessingSummaries = reprocessingSummaries
        }

        private enum CodingKeys: String, CodingKey {
            case activities
            case arn
            case creationTime
            case lastUpdateTime
            case name
            case reprocessingSummaries
        }
    }

    public struct PipelineActivity: AWSEncodableShape & AWSDecodableShape {
        /// Adds other attributes based on existing attributes in the message.
        public let addAttributes: AddAttributesActivity?
        /// Determines the source of the messages to be processed.
        public let channel: ChannelActivity?
        /// Specifies where to store the processed message data.
        public let datastore: DatastoreActivity?
        /// Adds data from the IoT device registry to your message.
        public let deviceRegistryEnrich: DeviceRegistryEnrichActivity?
        /// Adds information from the IoT Device Shadow service to a message.
        public let deviceShadowEnrich: DeviceShadowEnrichActivity?
        /// Filters a message based on its attributes.
        public let filter: FilterActivity?
        /// Runs a Lambda function to modify the message.
        public let lambda: LambdaActivity?
        /// Computes an arithmetic expression using the message's attributes and adds it to the message.
        public let math: MathActivity?
        /// Removes attributes from a message.
        public let removeAttributes: RemoveAttributesActivity?
        /// Used to create a new message using only the specified attributes from the original message.
        public let selectAttributes: SelectAttributesActivity?

        public init(addAttributes: AddAttributesActivity? = nil, channel: ChannelActivity? = nil, datastore: DatastoreActivity? = nil, deviceRegistryEnrich: DeviceRegistryEnrichActivity? = nil, deviceShadowEnrich: DeviceShadowEnrichActivity? = nil, filter: FilterActivity? = nil, lambda: LambdaActivity? = nil, math: MathActivity? = nil, removeAttributes: RemoveAttributesActivity? = nil, selectAttributes: SelectAttributesActivity? = nil) {
            self.addAttributes = addAttributes
            self.channel = channel
            self.datastore = datastore
            self.deviceRegistryEnrich = deviceRegistryEnrich
            self.deviceShadowEnrich = deviceShadowEnrich
            self.filter = filter
            self.lambda = lambda
            self.math = math
            self.removeAttributes = removeAttributes
            self.selectAttributes = selectAttributes
        }

        public func validate(name: String) throws {
            try self.addAttributes?.validate(name: "\(name).addAttributes")
            try self.channel?.validate(name: "\(name).channel")
            try self.datastore?.validate(name: "\(name).datastore")
            try self.deviceRegistryEnrich?.validate(name: "\(name).deviceRegistryEnrich")
            try self.deviceShadowEnrich?.validate(name: "\(name).deviceShadowEnrich")
            try self.filter?.validate(name: "\(name).filter")
            try self.lambda?.validate(name: "\(name).lambda")
            try self.math?.validate(name: "\(name).math")
            try self.removeAttributes?.validate(name: "\(name).removeAttributes")
            try self.selectAttributes?.validate(name: "\(name).selectAttributes")
        }

        private enum CodingKeys: String, CodingKey {
            case addAttributes
            case channel
            case datastore
            case deviceRegistryEnrich
            case deviceShadowEnrich
            case filter
            case lambda
            case math
            case removeAttributes
            case selectAttributes
        }
    }

    public struct PipelineSummary: AWSDecodableShape {
        /// When the pipeline was created.
        public let creationTime: Date?
        /// When the pipeline was last updated.
        public let lastUpdateTime: Date?
        /// The name of the pipeline.
        public let pipelineName: String?
        /// A summary of information about the pipeline reprocessing.
        public let reprocessingSummaries: [ReprocessingSummary]?

        public init(creationTime: Date? = nil, lastUpdateTime: Date? = nil, pipelineName: String? = nil, reprocessingSummaries: [ReprocessingSummary]? = nil) {
            self.creationTime = creationTime
            self.lastUpdateTime = lastUpdateTime
            self.pipelineName = pipelineName
            self.reprocessingSummaries = reprocessingSummaries
        }

        private enum CodingKeys: String, CodingKey {
            case creationTime
            case lastUpdateTime
            case pipelineName
            case reprocessingSummaries
        }
    }

    public struct PutLoggingOptionsRequest: AWSEncodableShape {
        /// The new values of the IoT Analytics logging options.
        public let loggingOptions: LoggingOptions

        public init(loggingOptions: LoggingOptions) {
            self.loggingOptions = loggingOptions
        }

        public func validate(name: String) throws {
            try self.loggingOptions.validate(name: "\(name).loggingOptions")
        }

        private enum CodingKeys: String, CodingKey {
            case loggingOptions
        }
    }

    public struct QueryFilter: AWSEncodableShape & AWSDecodableShape {
        /// Used to limit data to that which has arrived since the last execution of the action.
        public let deltaTime: DeltaTime?

        public init(deltaTime: DeltaTime? = nil) {
            self.deltaTime = deltaTime
        }

        private enum CodingKeys: String, CodingKey {
            case deltaTime
        }
    }

    public struct RemoveAttributesActivity: AWSEncodableShape & AWSDecodableShape {
        /// A list of 1-50 attributes to remove from the message.
        public let attributes: [String]
        /// The name of the removeAttributes activity.
        public let name: String
        /// The next activity in the pipeline.
        public let next: String?

        public init(attributes: [String], name: String, next: String? = nil) {
            self.attributes = attributes
            self.name = name
            self.next = next
        }

        public func validate(name: String) throws {
            try self.attributes.forEach {
                try validate($0, name: "attributes[]", parent: name, max: 256)
                try validate($0, name: "attributes[]", parent: name, min: 1)
            }
            try self.validate(self.attributes, name: "attributes", parent: name, max: 50)
            try self.validate(self.attributes, name: "attributes", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, max: 128)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.next, name: "next", parent: name, max: 128)
            try self.validate(self.next, name: "next", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case attributes
            case name
            case next
        }
    }

    public struct ReprocessingSummary: AWSDecodableShape {
        /// The time the pipeline reprocessing was created.
        public let creationTime: Date?
        /// The reprocessingId returned by StartPipelineReprocessing.
        public let id: String?
        /// The status of the pipeline reprocessing.
        public let status: ReprocessingStatus?

        public init(creationTime: Date? = nil, id: String? = nil, status: ReprocessingStatus? = nil) {
            self.creationTime = creationTime
            self.id = id
            self.status = status
        }

        private enum CodingKeys: String, CodingKey {
            case creationTime
            case id
            case status
        }
    }

    public struct ResourceConfiguration: AWSEncodableShape & AWSDecodableShape {
        /// The type of the compute resource used to execute the containerAction. Possible values are: ACU_1 (vCPU=4, memory=16 GiB) or ACU_2 (vCPU=8, memory=32 GiB).
        public let computeType: ComputeType
        /// The size, in GB, of the persistent storage available to the resource instance used to execute the containerAction (min: 1, max: 50).
        public let volumeSizeInGB: Int

        public init(computeType: ComputeType, volumeSizeInGB: Int) {
            self.computeType = computeType
            self.volumeSizeInGB = volumeSizeInGB
        }

        public func validate(name: String) throws {
            try self.validate(self.volumeSizeInGB, name: "volumeSizeInGB", parent: name, max: 50)
            try self.validate(self.volumeSizeInGB, name: "volumeSizeInGB", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case computeType
            case volumeSizeInGB
        }
    }

    public struct RetentionPeriod: AWSEncodableShape & AWSDecodableShape {
        /// The number of days that message data is kept. The unlimited parameter must be false.
        public let numberOfDays: Int?
        /// If true, message data is kept indefinitely.
        public let unlimited: Bool?

        public init(numberOfDays: Int? = nil, unlimited: Bool? = nil) {
            self.numberOfDays = numberOfDays
            self.unlimited = unlimited
        }

        public func validate(name: String) throws {
            try self.validate(self.numberOfDays, name: "numberOfDays", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case numberOfDays
            case unlimited
        }
    }

    public struct RunPipelineActivityRequest: AWSEncodableShape {
        /// The sample message payloads on which the pipeline activity is run.
        public let payloads: [AWSBase64Data]
        /// The pipeline activity that is run. This must not be a channel activity or a data store activity because these activities are used in a pipeline only to load the original message and to store the (possibly) transformed message. If a Lambda activity is specified, only short-running Lambda functions (those with a timeout of less than 30 seconds or less) can be used.
        public let pipelineActivity: PipelineActivity

        public init(payloads: [AWSBase64Data], pipelineActivity: PipelineActivity) {
            self.payloads = payloads
            self.pipelineActivity = pipelineActivity
        }

        public func validate(name: String) throws {
            try self.validate(self.payloads, name: "payloads", parent: name, max: 10)
            try self.validate(self.payloads, name: "payloads", parent: name, min: 1)
            try self.pipelineActivity.validate(name: "\(name).pipelineActivity")
        }

        private enum CodingKeys: String, CodingKey {
            case payloads
            case pipelineActivity
        }
    }

    public struct RunPipelineActivityResponse: AWSDecodableShape {
        /// In case the pipeline activity fails, the log message that is generated.
        public let logResult: String?
        /// The enriched or transformed sample message payloads as base64-encoded strings. (The results of running the pipeline activity on each input sample message payload, encoded in base64.)
        public let payloads: [AWSBase64Data]?

        public init(logResult: String? = nil, payloads: [AWSBase64Data]? = nil) {
            self.logResult = logResult
            self.payloads = payloads
        }

        private enum CodingKeys: String, CodingKey {
            case logResult
            case payloads
        }
    }

    public struct S3DestinationConfiguration: AWSEncodableShape & AWSDecodableShape {
        /// The name of the S3 bucket to which dataset contents are delivered.
        public let bucket: String
        /// Configuration information for coordination with Glue, a fully managed extract, transform and load (ETL) service.
        public let glueConfiguration: GlueConfiguration?
        /// The key of the dataset contents object in an S3 bucket. Each object has a key that is a unique identifier. Each object has exactly one key. You can create a unique key with the following options:   Use !{iotanalytics:scheduleTime} to insert the time of a scheduled SQL query run.   Use !{iotanalytics:versionId} to insert a unique hash that identifies a dataset content.   Use !{iotanalytics:creationTime} to insert the creation time of a dataset content.   The following example creates a unique key for a CSV file: dataset/mydataset/!{iotanalytics:scheduleTime}/!{iotanalytics:versionId}.csv   If you don't use !{iotanalytics:versionId} to specify the key, you might get duplicate keys. For example, you might have two dataset contents with the same scheduleTime but different versionIds. This means that one dataset content overwrites the other.
        public let key: String
        /// The ARN of the role that grants IoT Analytics permission to interact with your Amazon S3 and Glue resources.
        public let roleArn: String

        public init(bucket: String, glueConfiguration: GlueConfiguration? = nil, key: String, roleArn: String) {
            self.bucket = bucket
            self.glueConfiguration = glueConfiguration
            self.key = key
            self.roleArn = roleArn
        }

        public func validate(name: String) throws {
            try self.validate(self.bucket, name: "bucket", parent: name, max: 255)
            try self.validate(self.bucket, name: "bucket", parent: name, min: 3)
            try self.validate(self.bucket, name: "bucket", parent: name, pattern: "^[a-zA-Z0-9.\\-_]*$")
            try self.glueConfiguration?.validate(name: "\(name).glueConfiguration")
            try self.validate(self.key, name: "key", parent: name, max: 255)
            try self.validate(self.key, name: "key", parent: name, min: 1)
            try self.validate(self.key, name: "key", parent: name, pattern: "^[a-zA-Z0-9!_.*'()/{}:-]*$")
            try self.validate(self.roleArn, name: "roleArn", parent: name, max: 2048)
            try self.validate(self.roleArn, name: "roleArn", parent: name, min: 20)
        }

        private enum CodingKeys: String, CodingKey {
            case bucket
            case glueConfiguration
            case key
            case roleArn
        }
    }

    public struct SampleChannelDataRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "channelName", location: .uri("channelName")),
            AWSMemberEncoding(label: "endTime", location: .querystring("endTime")),
            AWSMemberEncoding(label: "maxMessages", location: .querystring("maxMessages")),
            AWSMemberEncoding(label: "startTime", location: .querystring("startTime"))
        ]

        /// The name of the channel whose message samples are retrieved.
        public let channelName: String
        /// The end of the time window from which sample messages are retrieved.
        public let endTime: Date?
        /// The number of sample messages to be retrieved. The limit is 10. The default is also 10.
        public let maxMessages: Int?
        /// The start of the time window from which sample messages are retrieved.
        public let startTime: Date?

        public init(channelName: String, endTime: Date? = nil, maxMessages: Int? = nil, startTime: Date? = nil) {
            self.channelName = channelName
            self.endTime = endTime
            self.maxMessages = maxMessages
            self.startTime = startTime
        }

        public func validate(name: String) throws {
            try self.validate(self.channelName, name: "channelName", parent: name, max: 128)
            try self.validate(self.channelName, name: "channelName", parent: name, min: 1)
            try self.validate(self.channelName, name: "channelName", parent: name, pattern: "^(^(?!_{2}))(^[a-zA-Z0-9_]+$)$")
            try self.validate(self.maxMessages, name: "maxMessages", parent: name, max: 10)
            try self.validate(self.maxMessages, name: "maxMessages", parent: name, min: 1)
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct SampleChannelDataResponse: AWSDecodableShape {
        /// The list of message samples. Each sample message is returned as a base64-encoded string.
        public let payloads: [AWSBase64Data]?

        public init(payloads: [AWSBase64Data]? = nil) {
            self.payloads = payloads
        }

        private enum CodingKeys: String, CodingKey {
            case payloads
        }
    }

    public struct Schedule: AWSEncodableShape & AWSDecodableShape {
        /// The expression that defines when to trigger an update. For more information, see Schedule Expressions for Rules in the Amazon CloudWatch Events User Guide.
        public let expression: String?

        public init(expression: String? = nil) {
            self.expression = expression
        }

        private enum CodingKeys: String, CodingKey {
            case expression
        }
    }

    public struct SchemaDefinition: AWSEncodableShape & AWSDecodableShape {
        /// Specifies one or more columns that store your data. Each schema can have up to 100 columns. Each column can have up to 100 nested types.
        public let columns: [Column]?

        public init(columns: [Column]? = nil) {
            self.columns = columns
        }

        public func validate(name: String) throws {
            try self.columns?.forEach {
                try $0.validate(name: "\(name).columns[]")
            }
        }

        private enum CodingKeys: String, CodingKey {
            case columns
        }
    }

    public struct SelectAttributesActivity: AWSEncodableShape & AWSDecodableShape {
        /// A list of the attributes to select from the message.
        public let attributes: [String]
        /// The name of the selectAttributes activity.
        public let name: String
        /// The next activity in the pipeline.
        public let next: String?

        public init(attributes: [String], name: String, next: String? = nil) {
            self.attributes = attributes
            self.name = name
            self.next = next
        }

        public func validate(name: String) throws {
            try self.attributes.forEach {
                try validate($0, name: "attributes[]", parent: name, max: 256)
                try validate($0, name: "attributes[]", parent: name, min: 1)
            }
            try self.validate(self.attributes, name: "attributes", parent: name, max: 50)
            try self.validate(self.attributes, name: "attributes", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, max: 128)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.next, name: "next", parent: name, max: 128)
            try self.validate(self.next, name: "next", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case attributes
            case name
            case next
        }
    }

    public struct ServiceManagedChannelS3Storage: AWSEncodableShape & AWSDecodableShape {
        public init() {}
    }

    public struct ServiceManagedChannelS3StorageSummary: AWSDecodableShape {
        public init() {}
    }

    public struct ServiceManagedDatastoreS3Storage: AWSEncodableShape & AWSDecodableShape {
        public init() {}
    }

    public struct ServiceManagedDatastoreS3StorageSummary: AWSDecodableShape {
        public init() {}
    }

    public struct SqlQueryDatasetAction: AWSEncodableShape & AWSDecodableShape {
        /// Prefilters applied to message data.
        public let filters: [QueryFilter]?
        /// A SQL query string.
        public let sqlQuery: String

        public init(filters: [QueryFilter]? = nil, sqlQuery: String) {
            self.filters = filters
            self.sqlQuery = sqlQuery
        }

        public func validate(name: String) throws {
            try self.validate(self.filters, name: "filters", parent: name, max: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case filters
            case sqlQuery
        }
    }

    public struct StartPipelineReprocessingRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "pipelineName", location: .uri("pipelineName"))
        ]

        /// Specifies one or more sets of channel messages that you want to reprocess. If you use the channelMessages object, you must not specify a value for startTime and endTime.
        public let channelMessages: ChannelMessages?
        /// The end time (exclusive) of raw message data that is reprocessed. If you specify a value for the endTime parameter, you must not use the channelMessages object.
        public let endTime: Date?
        /// The name of the pipeline on which to start reprocessing.
        public let pipelineName: String
        /// The start time (inclusive) of raw message data that is reprocessed. If you specify a value for the startTime parameter, you must not use the channelMessages object.
        public let startTime: Date?

        public init(channelMessages: ChannelMessages? = nil, endTime: Date? = nil, pipelineName: String, startTime: Date? = nil) {
            self.channelMessages = channelMessages
            self.endTime = endTime
            self.pipelineName = pipelineName
            self.startTime = startTime
        }

        public func validate(name: String) throws {
            try self.channelMessages?.validate(name: "\(name).channelMessages")
            try self.validate(self.pipelineName, name: "pipelineName", parent: name, max: 128)
            try self.validate(self.pipelineName, name: "pipelineName", parent: name, min: 1)
            try self.validate(self.pipelineName, name: "pipelineName", parent: name, pattern: "^(^(?!_{2}))(^[a-zA-Z0-9_]+$)$")
        }

        private enum CodingKeys: String, CodingKey {
            case channelMessages
            case endTime
            case startTime
        }
    }

    public struct StartPipelineReprocessingResponse: AWSDecodableShape {
        /// The ID of the pipeline reprocessing activity that was started.
        public let reprocessingId: String?

        public init(reprocessingId: String? = nil) {
            self.reprocessingId = reprocessingId
        }

        private enum CodingKeys: String, CodingKey {
            case reprocessingId
        }
    }

    public struct Tag: AWSEncodableShape & AWSDecodableShape {
        /// The tag's key.
        public let key: String
        /// The tag's value.
        public let value: String

        public init(key: String, value: String) {
            self.key = key
            self.value = value
        }

        public func validate(name: String) throws {
            try self.validate(self.key, name: "key", parent: name, max: 256)
            try self.validate(self.key, name: "key", parent: name, min: 1)
            try self.validate(self.value, name: "value", parent: name, max: 256)
            try self.validate(self.value, name: "value", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case key
            case value
        }
    }

    public struct TagResourceRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "resourceArn", location: .querystring("resourceArn"))
        ]

        /// The ARN of the resource whose tags you want to modify.
        public let resourceArn: String
        /// The new or modified tags for the resource.
        public let tags: [Tag]

        public init(resourceArn: String, tags: [Tag]) {
            self.resourceArn = resourceArn
            self.tags = tags
        }

        public func validate(name: String) throws {
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, max: 2048)
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, min: 20)
            try self.tags.forEach {
                try $0.validate(name: "\(name).tags[]")
            }
            try self.validate(self.tags, name: "tags", parent: name, max: 50)
            try self.validate(self.tags, name: "tags", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case tags
        }
    }

    public struct TagResourceResponse: AWSDecodableShape {
        public init() {}
    }

    public struct TimestampPartition: AWSEncodableShape & AWSDecodableShape {
        ///  The attribute name of the partition defined by a timestamp.
        public let attributeName: String
        ///  The timestamp format of a partition defined by a timestamp. The default format is seconds since epoch (January 1, 1970 at midnight UTC time).
        public let timestampFormat: String?

        public init(attributeName: String, timestampFormat: String? = nil) {
            self.attributeName = attributeName
            self.timestampFormat = timestampFormat
        }

        public func validate(name: String) throws {
            try self.validate(self.attributeName, name: "attributeName", parent: name, max: 128)
            try self.validate(self.attributeName, name: "attributeName", parent: name, min: 1)
            try self.validate(self.attributeName, name: "attributeName", parent: name, pattern: "^[a-zA-Z0-9_]+$")
            try self.validate(self.timestampFormat, name: "timestampFormat", parent: name, max: 50)
            try self.validate(self.timestampFormat, name: "timestampFormat", parent: name, min: 1)
            try self.validate(self.timestampFormat, name: "timestampFormat", parent: name, pattern: "^[a-zA-Z0-9\\s\\[\\]_,.'/:-]*$")
        }

        private enum CodingKeys: String, CodingKey {
            case attributeName
            case timestampFormat
        }
    }

    public struct TriggeringDataset: AWSEncodableShape & AWSDecodableShape {
        /// The name of the dataset whose content generation triggers the new dataset content generation.
        public let name: String

        public init(name: String) {
            self.name = name
        }

        public func validate(name: String) throws {
            try self.validate(self.name, name: "name", parent: name, max: 128)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, pattern: "^(^(?!_{2}))(^[a-zA-Z0-9_]+$)$")
        }

        private enum CodingKeys: String, CodingKey {
            case name
        }
    }

    public struct UntagResourceRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "resourceArn", location: .querystring("resourceArn")),
            AWSMemberEncoding(label: "tagKeys", location: .querystring("tagKeys"))
        ]

        /// The ARN of the resource whose tags you want to remove.
        public let resourceArn: String
        /// The keys of those tags which you want to remove.
        public let tagKeys: [String]

        public init(resourceArn: String, tagKeys: [String]) {
            self.resourceArn = resourceArn
            self.tagKeys = tagKeys
        }

        public func validate(name: String) throws {
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, max: 2048)
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, min: 20)
            try self.tagKeys.forEach {
                try validate($0, name: "tagKeys[]", parent: name, max: 256)
                try validate($0, name: "tagKeys[]", parent: name, min: 1)
            }
            try self.validate(self.tagKeys, name: "tagKeys", parent: name, max: 50)
            try self.validate(self.tagKeys, name: "tagKeys", parent: name, min: 1)
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct UntagResourceResponse: AWSDecodableShape {
        public init() {}
    }

    public struct UpdateChannelRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "channelName", location: .uri("channelName"))
        ]

        /// The name of the channel to be updated.
        public let channelName: String
        /// Where channel data is stored. You can choose one of serviceManagedS3 or customerManagedS3 storage. If not specified, the default is serviceManagedS3. You can't change this storage option after the channel is created.
        public let channelStorage: ChannelStorage?
        /// How long, in days, message data is kept for the channel. The retention period can't be updated if the channel's Amazon S3 storage is customer-managed.
        public let retentionPeriod: RetentionPeriod?

        public init(channelName: String, channelStorage: ChannelStorage? = nil, retentionPeriod: RetentionPeriod? = nil) {
            self.channelName = channelName
            self.channelStorage = channelStorage
            self.retentionPeriod = retentionPeriod
        }

        public func validate(name: String) throws {
            try self.validate(self.channelName, name: "channelName", parent: name, max: 128)
            try self.validate(self.channelName, name: "channelName", parent: name, min: 1)
            try self.validate(self.channelName, name: "channelName", parent: name, pattern: "^(^(?!_{2}))(^[a-zA-Z0-9_]+$)$")
            try self.channelStorage?.validate(name: "\(name).channelStorage")
            try self.retentionPeriod?.validate(name: "\(name).retentionPeriod")
        }

        private enum CodingKeys: String, CodingKey {
            case channelStorage
            case retentionPeriod
        }
    }

    public struct UpdateDatasetRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "datasetName", location: .uri("datasetName"))
        ]

        /// A list of DatasetAction objects.
        public let actions: [DatasetAction]
        /// When dataset contents are created, they are delivered to destinations specified here.
        public let contentDeliveryRules: [DatasetContentDeliveryRule]?
        /// The name of the dataset to update.
        public let datasetName: String
        /// A list of data rules that send notifications to CloudWatch, when data arrives late. To specify lateDataRules, the dataset must use a DeltaTimer filter.
        public let lateDataRules: [LateDataRule]?
        /// How long, in days, dataset contents are kept for the dataset.
        public let retentionPeriod: RetentionPeriod?
        /// A list of DatasetTrigger objects. The list can be empty or can contain up to five DatasetTrigger objects.
        public let triggers: [DatasetTrigger]?
        /// Optional. How many versions of dataset contents are kept. If not specified or set to null, only the latest version plus the latest succeeded version (if they are different) are kept for the time period specified by the retentionPeriod parameter. For more information, see Keeping Multiple Versions of IoT Analytics datasets in the IoT Analytics User Guide.
        public let versioningConfiguration: VersioningConfiguration?

        public init(actions: [DatasetAction], contentDeliveryRules: [DatasetContentDeliveryRule]? = nil, datasetName: String, lateDataRules: [LateDataRule]? = nil, retentionPeriod: RetentionPeriod? = nil, triggers: [DatasetTrigger]? = nil, versioningConfiguration: VersioningConfiguration? = nil) {
            self.actions = actions
            self.contentDeliveryRules = contentDeliveryRules
            self.datasetName = datasetName
            self.lateDataRules = lateDataRules
            self.retentionPeriod = retentionPeriod
            self.triggers = triggers
            self.versioningConfiguration = versioningConfiguration
        }

        public func validate(name: String) throws {
            try self.actions.forEach {
                try $0.validate(name: "\(name).actions[]")
            }
            try self.validate(self.actions, name: "actions", parent: name, max: 1)
            try self.validate(self.actions, name: "actions", parent: name, min: 1)
            try self.contentDeliveryRules?.forEach {
                try $0.validate(name: "\(name).contentDeliveryRules[]")
            }
            try self.validate(self.contentDeliveryRules, name: "contentDeliveryRules", parent: name, max: 20)
            try self.validate(self.datasetName, name: "datasetName", parent: name, max: 128)
            try self.validate(self.datasetName, name: "datasetName", parent: name, min: 1)
            try self.validate(self.datasetName, name: "datasetName", parent: name, pattern: "^(^(?!_{2}))(^[a-zA-Z0-9_]+$)$")
            try self.lateDataRules?.forEach {
                try $0.validate(name: "\(name).lateDataRules[]")
            }
            try self.validate(self.lateDataRules, name: "lateDataRules", parent: name, max: 1)
            try self.validate(self.lateDataRules, name: "lateDataRules", parent: name, min: 1)
            try self.retentionPeriod?.validate(name: "\(name).retentionPeriod")
            try self.triggers?.forEach {
                try $0.validate(name: "\(name).triggers[]")
            }
            try self.validate(self.triggers, name: "triggers", parent: name, max: 5)
            try self.versioningConfiguration?.validate(name: "\(name).versioningConfiguration")
        }

        private enum CodingKeys: String, CodingKey {
            case actions
            case contentDeliveryRules
            case lateDataRules
            case retentionPeriod
            case triggers
            case versioningConfiguration
        }
    }

    public struct UpdateDatastoreRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "datastoreName", location: .uri("datastoreName"))
        ]

        /// The name of the data store to be updated.
        public let datastoreName: String
        /// Where data in a data store is stored.. You can choose serviceManagedS3 storage, customerManagedS3 storage, or iotSiteWiseMultiLayerStorage storage. The default is serviceManagedS3. You can't change the choice of Amazon S3 storage after your data store is created.
        public let datastoreStorage: DatastoreStorage?
        /// Contains the configuration information of file formats.  IoT Analytics data stores support JSON and Parquet.  The default file format is JSON. You can specify only one format.  You can't change the file format after you create the data store.
        public let fileFormatConfiguration: FileFormatConfiguration?
        /// How long, in days, message data is kept for the data store. The retention period can't be updated if the data store's Amazon S3 storage is customer-managed.
        public let retentionPeriod: RetentionPeriod?

        public init(datastoreName: String, datastoreStorage: DatastoreStorage? = nil, fileFormatConfiguration: FileFormatConfiguration? = nil, retentionPeriod: RetentionPeriod? = nil) {
            self.datastoreName = datastoreName
            self.datastoreStorage = datastoreStorage
            self.fileFormatConfiguration = fileFormatConfiguration
            self.retentionPeriod = retentionPeriod
        }

        public func validate(name: String) throws {
            try self.validate(self.datastoreName, name: "datastoreName", parent: name, max: 128)
            try self.validate(self.datastoreName, name: "datastoreName", parent: name, min: 1)
            try self.validate(self.datastoreName, name: "datastoreName", parent: name, pattern: "^(^(?!_{2}))(^[a-zA-Z0-9_]+$)$")
            try self.datastoreStorage?.validate(name: "\(name).datastoreStorage")
            try self.fileFormatConfiguration?.validate(name: "\(name).fileFormatConfiguration")
            try self.retentionPeriod?.validate(name: "\(name).retentionPeriod")
        }

        private enum CodingKeys: String, CodingKey {
            case datastoreStorage
            case fileFormatConfiguration
            case retentionPeriod
        }
    }

    public struct UpdatePipelineRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "pipelineName", location: .uri("pipelineName"))
        ]

        /// A list of PipelineActivity objects. Activities perform transformations on your messages, such as removing, renaming or adding message attributes; filtering messages based on attribute values; invoking your Lambda functions on messages for advanced processing; or performing mathematical transformations to normalize device data. The list can be 2-25 PipelineActivity objects and must contain both a channel and a datastore activity. Each entry in the list must contain only one activity. For example:  pipelineActivities = [ { "channel": { ... } }, { "lambda": { ... } }, ... ]
        public let pipelineActivities: [PipelineActivity]
        /// The name of the pipeline to update.
        public let pipelineName: String

        public init(pipelineActivities: [PipelineActivity], pipelineName: String) {
            self.pipelineActivities = pipelineActivities
            self.pipelineName = pipelineName
        }

        public func validate(name: String) throws {
            try self.pipelineActivities.forEach {
                try $0.validate(name: "\(name).pipelineActivities[]")
            }
            try self.validate(self.pipelineActivities, name: "pipelineActivities", parent: name, max: 25)
            try self.validate(self.pipelineActivities, name: "pipelineActivities", parent: name, min: 1)
            try self.validate(self.pipelineName, name: "pipelineName", parent: name, max: 128)
            try self.validate(self.pipelineName, name: "pipelineName", parent: name, min: 1)
            try self.validate(self.pipelineName, name: "pipelineName", parent: name, pattern: "^(^(?!_{2}))(^[a-zA-Z0-9_]+$)$")
        }

        private enum CodingKeys: String, CodingKey {
            case pipelineActivities
        }
    }

    public struct Variable: AWSEncodableShape & AWSDecodableShape {
        /// The value of the variable as a structure that specifies a dataset content version.
        public let datasetContentVersionValue: DatasetContentVersionValue?
        /// The value of the variable as a double (numeric).
        public let doubleValue: Double?
        /// The name of the variable.
        public let name: String
        /// The value of the variable as a structure that specifies an output file URI.
        public let outputFileUriValue: OutputFileUriValue?
        /// The value of the variable as a string.
        public let stringValue: String?

        public init(datasetContentVersionValue: DatasetContentVersionValue? = nil, doubleValue: Double? = nil, name: String, outputFileUriValue: OutputFileUriValue? = nil, stringValue: String? = nil) {
            self.datasetContentVersionValue = datasetContentVersionValue
            self.doubleValue = doubleValue
            self.name = name
            self.outputFileUriValue = outputFileUriValue
            self.stringValue = stringValue
        }

        public func validate(name: String) throws {
            try self.datasetContentVersionValue?.validate(name: "\(name).datasetContentVersionValue")
            try self.validate(self.name, name: "name", parent: name, max: 256)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.outputFileUriValue?.validate(name: "\(name).outputFileUriValue")
            try self.validate(self.stringValue, name: "stringValue", parent: name, max: 1024)
        }

        private enum CodingKeys: String, CodingKey {
            case datasetContentVersionValue
            case doubleValue
            case name
            case outputFileUriValue
            case stringValue
        }
    }

    public struct VersioningConfiguration: AWSEncodableShape & AWSDecodableShape {
        /// How many versions of dataset contents are kept. The unlimited parameter must be false.
        public let maxVersions: Int?
        /// If true, unlimited versions of dataset contents are kept.
        public let unlimited: Bool?

        public init(maxVersions: Int? = nil, unlimited: Bool? = nil) {
            self.maxVersions = maxVersions
            self.unlimited = unlimited
        }

        public func validate(name: String) throws {
            try self.validate(self.maxVersions, name: "maxVersions", parent: name, max: 1000)
            try self.validate(self.maxVersions, name: "maxVersions", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case maxVersions
            case unlimited
        }
    }
}

// MARK: - Errors

/// Error enum for IoTAnalytics
public struct IoTAnalyticsErrorType: AWSErrorType {
    enum Code: String {
        case internalFailureException = "InternalFailureException"
        case invalidRequestException = "InvalidRequestException"
        case limitExceededException = "LimitExceededException"
        case resourceAlreadyExistsException = "ResourceAlreadyExistsException"
        case resourceNotFoundException = "ResourceNotFoundException"
        case serviceUnavailableException = "ServiceUnavailableException"
        case throttlingException = "ThrottlingException"
    }

    private let error: Code
    public let context: AWSErrorContext?

    /// initialize IoTAnalytics
    public init?(errorCode: String, context: AWSErrorContext) {
        guard let error = Code(rawValue: errorCode) else { return nil }
        self.error = error
        self.context = context
    }

    internal init(_ error: Code) {
        self.error = error
        self.context = nil
    }

    /// return error code string
    public var errorCode: String { self.error.rawValue }

    /// There was an internal failure.
    public static var internalFailureException: Self { .init(.internalFailureException) }
    /// The request was not valid.
    public static var invalidRequestException: Self { .init(.invalidRequestException) }
    /// The command caused an internal limit to be exceeded.
    public static var limitExceededException: Self { .init(.limitExceededException) }
    /// A resource with the same name already exists.
    public static var resourceAlreadyExistsException: Self { .init(.resourceAlreadyExistsException) }
    /// A resource with the specified name could not be found.
    public static var resourceNotFoundException: Self { .init(.resourceNotFoundException) }
    /// The service is temporarily unavailable.
    public static var serviceUnavailableException: Self { .init(.serviceUnavailableException) }
    /// The request was denied due to request throttling.
    public static var throttlingException: Self { .init(.throttlingException) }
}

extension IoTAnalyticsErrorType: Equatable {
    public static func == (lhs: IoTAnalyticsErrorType, rhs: IoTAnalyticsErrorType) -> Bool {
        lhs.error == rhs.error
    }
}

extension IoTAnalyticsErrorType: CustomStringConvertible {
    public var description: String {
        return "\(self.error.rawValue): \(self.message ?? "")"
    }
}
